Scheduled Tests #1079
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
# Note that this file intentionally uses no cache, see | |
# https://github.com/metoppv/improver/pull/1651#issue-1108889073 | |
name: Scheduled Tests | |
on: | |
schedule: | |
- cron: '7 4 * * *' | |
workflow_dispatch: | |
jobs: | |
Sphinx-Pytest-Coverage: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
env: [latest] | |
if: github.repository_owner == 'metoppv' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: conda env update | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda update -q -n base -c defaults conda | |
conda install -q -n base -c conda-forge -c nodefaults mamba | |
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488 | |
mamba env create -q --file envs/${{ matrix.env }}.yml --name im${{ matrix.env }} | |
- name: conda info | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
conda info | |
conda list | |
- name: sphinx documentation | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
make -C doc html SPHINXOPTS="-W --keep-going" | |
- name: pytest without coverage | |
if: matrix.env != 'environment_a' | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
pytest | |
- name: pytest with coverage | |
if: matrix.env == 'environment_a' | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
pytest --cov=improver --cov-report xml:coverage.xml | |
- name: codacy upload | |
if: env.CODACY_PROJECT_TOKEN && matrix.env == 'environment_a' | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
python-codacy-coverage -v -r coverage.xml | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
- name: codecov upload | |
uses: codecov/codecov-action@v4 | |
if: matrix.env == 'environment_a' | |
Safety-Bandit: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
env: [latest] | |
if: github.repository_owner == 'metoppv' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: conda env update | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda update -q -n base -c defaults conda | |
conda install -q -n base -c conda-forge -c nodefaults mamba | |
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488 | |
mamba env create -q --file envs/${{ matrix.env }}.yml --name im${{ matrix.env }} | |
- name: conda info | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
conda info | |
conda list | |
- name: safety | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
safety check || true | |
- name: bandit | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
bandit -r improver | |
Type-checking: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
env: [latest] | |
if: github.repository_owner == 'metoppv' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: conda env update | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda update -q -n base -c defaults conda | |
conda install -q -n base -c conda-forge -c nodefaults mamba | |
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488 | |
mamba env create -q --file envs/${{ matrix.env }}.yml --name im${{ matrix.env }} | |
- name: conda info | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
conda info | |
conda list | |
- name: mypy | |
run: | | |
source '/usr/share/miniconda/etc/profile.d/conda.sh' | |
conda activate im${{ matrix.env }} | |
mypy improver || true |