-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handling and documentation of dependencies (#1589)
* Rename and add environments * Thin out requirements in setup.cfg, add note * Remove improver_tests tests from built package The previous exclude was not effective - it excluded the top level directory, but not the subdirectories containing all the test source code files. * Skip checksum sorted test if file not available * Pytest skips for stratify * Move stratify import inside function * Remove duplicated statsmodels * Better explanation for latest environment * Add sphinx typehints to conda-forge tests section * Run security checks on all environments * Separate coverage and no-coverage environments * Add detailed pinning to A/B environments * Pin numpy/cartopy in latest environment Unit test failures occur with older versions * Start documentation * Remove dateutil dependency * More documentation * Remove timezone database dependence in unit test * Fix duplicated name in conda-forge environment * Add note that not all CLIs are available with environment_b * Remove leftover expected data from test_process * Fix flake8 * Remove not-really-working install_requires section * Clarify conda-forge environment comment * Move latest environment tests to schedule * Fix actions YAML * Reschedule * Fix scheduling, add manual running, metoppv-only * Add timezone mask test on europe lat/lon domain
- Loading branch information
Showing
18 changed files
with
600 additions
and
207 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
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 | ||
- uses: actions/cache@v2 | ||
id: cache | ||
env: | ||
# Increase this value to reset cache | ||
CACHE_NUMBER: 2 | ||
with: | ||
path: /usr/share/miniconda/envs/im${{ matrix.env }} | ||
key: ${{ format('{0}-conda-improver-{1}-{2}-{3}', runner.os, env.CACHE_NUMBER, matrix.env, hashFiles(format('envs/{0}.yml', matrix.env))) }} | ||
- name: conda env update | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
source '/usr/share/miniconda/etc/profile.d/conda.sh' | ||
conda install -c conda-forge mamba | ||
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 | ||
- uses: actions/cache@v2 | ||
id: cache | ||
env: | ||
# Increase this value to reset cache | ||
CACHE_NUMBER: 2 | ||
with: | ||
path: /usr/share/miniconda/envs/im${{ matrix.env }} | ||
key: ${{ format('{0}-conda-improver-{1}-{2}-{3}', runner.os, env.CACHE_NUMBER, matrix.env, hashFiles(format('envs/{0}.yml', matrix.env))) }} | ||
- name: conda env update | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
source '/usr/share/miniconda/etc/profile.d/conda.sh' | ||
conda install -c conda-forge mamba | ||
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 | ||
- uses: actions/cache@v2 | ||
id: cache | ||
env: | ||
# Increase this value to reset cache | ||
CACHE_NUMBER: 2 | ||
with: | ||
path: /usr/share/miniconda/envs/im${{ matrix.env }} | ||
key: ${{ format('{0}-conda-improver-{1}-{2}-{3}', runner.os, env.CACHE_NUMBER, matrix.env, hashFiles(format('envs/{0}.yml', matrix.env))) }} | ||
- name: conda env update | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
source '/usr/share/miniconda/etc/profile.d/conda.sh' | ||
conda install -c conda-forge mamba | ||
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 |
Oops, something went wrong.