Update base project config files #57
Workflow file for this run
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
# Builds the aeon environment, flakes via flake8, checks type annotations via mypy, tests via pytest, | |
# reports test coverage via pytest-cov and codecov, and reports security vulnerabilities via bandit. | |
name: build_env_run_tests | |
on: | |
push: | |
branches: [ main, reorg, jai_dev, config ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: # Allows running manually from Github's 'Actions' tab | |
jobs: | |
build_env_run_tests: | |
name: Build env and run tests on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash -l {0} # reset shell for each step | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v2 | |
- name: set up conda env | |
uses: conda-incubator/setup-miniconda@v2 # from github marketplace | |
with: | |
activate-environment: aeon | |
environment-file: ./env_config/env.yml | |
use-mamba: true | |
miniforge-variant: Mambaforge | |
- name: Update conda env with dev reqs | |
run: mamba env update -f ./env_config/env_dev.yml | |
- name: flake | |
run: python -m flake8 . | |
- name: mypy | |
run: python -m mypy . | |
- name: bandit | |
run: python -m bandit . -r -ll | |
- name: pytest | |
run: python -m pytest tests/ | |
# Only run coverage report job and upload for ubuntu. | |
- name: generate test coverage report | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
python -m pytest --cov=aeon ./tests/ --cov-report=xml:./tests/test_coverage/test_coverage_report.xml | |
python -m pytest --cov=aeon ./tests/ --cov-report=html:./tests/test_coverage/test_coverage_report_html | |
- name: upload test coverage report to codecov | |
if: matrix.os == 'ubuntu-latest' | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./tests/test_coverage/ | |
files: test_coverage_report.xml | |
fail_ci_if_error: true | |
verbose: true |