Skip to content

Scheduled Tests

Scheduled Tests #434

Workflow file for this run

# 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-latest
strategy:
fail-fast: false
matrix:
env: [latest]
if: github.repository_owner == 'metoppv'
steps:
- uses: actions/checkout@v2
- name: conda env update
run: |
source '/usr/share/miniconda/etc/profile.d/conda.sh'
conda install -c conda-forge mamba
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488
mamba env update -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@v1
if: matrix.env == 'environment_a'
Safety-Bandit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env: [latest]
if: github.repository_owner == 'metoppv'
steps:
- uses: actions/checkout@v2
- name: conda env update
run: |
source '/usr/share/miniconda/etc/profile.d/conda.sh'
conda install -c conda-forge mamba
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488
mamba env update -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-latest
strategy:
fail-fast: false
matrix:
env: [latest]
if: github.repository_owner == 'metoppv'
steps:
- uses: actions/checkout@v2
- name: conda env update
run: |
source '/usr/share/miniconda/etc/profile.d/conda.sh'
conda install -c conda-forge mamba
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488
mamba env update -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