Skip to content

archive download

archive download #131

Workflow file for this run

name: Unit Tests
on:
push:
pull_request:
branches:
- develop
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: [ 3.7, 3.8 ]
os: [ ubuntu-18.04, ubuntu-20.04 ]
steps:
- name: Checkout ${{ matrix.python-version }}
uses: actions/checkout@v2
with:
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
pip install -r requirements.txt
- name: Check licenses
run: |
# stop the build if there are licensing issues
liccheck --sfile strategy.ini --rfile tests/requirements.txt --level CAUTIOUS --reporting liccheck-output.txt --no-deps
liccheck --sfile strategy.ini --rfile requirements.txt --level CAUTIOUS --reporting liccheck-output.txt --no-deps
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run unit tests with coverage
env:
TEST_GCP_BUCKET_NAME: ${{ secrets.TEST_GCP_BUCKET_NAME }}
TEST_GCP_SERVICE_KEY: ${{ secrets.TEST_GCP_SERVICE_KEY }}
GOOGLE_APPLICATION_CREDENTIALS: /tmp/google_application_credentials.json
run: |
echo "${TEST_GCP_SERVICE_KEY}" | base64 --decode > /tmp/google_application_credentials.json
coverage run -m unittest discover
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: false