Fix test workflow for minio 2 #381
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
code_test: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]') | |
runs-on: ubuntu-latest | |
services: | |
zookeeper: | |
image: bitnami/zookeeper:latest | |
ports: | |
- 2181:2181 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 and pip | |
run: | | |
sudo add-apt-repository ppa:deadsnakes/ppa -y | |
sudo apt update | |
sudo apt install -y python3.9 python3.9-distutils | |
curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
sudo python3.9 get-pip.py | |
- name: Install project dependencies | |
run: | | |
pip install -r resources/src/requirements.txt | |
- name: Start Minio | |
run: | | |
docker run -d --name minio \ | |
-e MINIO_ACCESS_KEY=minioadmin \ | |
-e MINIO_SECRET_KEY=minioadmin \ | |
-p 9000:9000 \ | |
minio/minio server /data | |
- name: Run tests | |
run: | | |
pip install coverage | |
coverage run --source=resources/src -m unittest discover -s resources/tests -p 'test_*.py' | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/reports/ | |
env_vars: OS,PYTHON | |
files: /home/runner/work/rb-aioutliers/rb-aioutliers/coverage.xml | |
flags: tests | |
run_outliers: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 and pip | |
run: | | |
sudo add-apt-repository ppa:deadsnakes/ppa -y | |
sudo apt update | |
sudo apt install -y python3.9 python3.9-distutils | |
curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
sudo python3.9 get-pip.py | |
- name: Install dependencies | |
run: | | |
pip install -r resources/src/requirements.txt | |
- name: Run outliers | |
run: | | |
ENVIRONMENT=test python3.9 resources/src/__main__.py |