Skip to content

tests

tests #1366

Workflow file for this run

name: tests
on:
pull_request:
workflow_dispatch:
push:
branches: [master]
schedule:
- cron: '53 0 * * 1-5' # 00:53 Mon-Fri
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
env:
PYTEST_ADDOPTS: --cov --cov-append --color=yes
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install libs
uses: cylc/release-actions/install-cylc-components@v1
with:
cylc_flow: true
cylc_flow_opts: 'empy'
metomi_rose: true
metomi_rose_opts: 'tests'
- name: Install cylc-rose
# need editable install for coverage
run: |
pip install -e .[all]
- name: Style
run: |
flake8
- name: Mypy
run: mypy
- name: Checkout FCM
uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.fcm_repo || 'metomi/fcm' }}
ref: ${{ github.event.inputs.fcm_ref || 'master' }}
path: 'fcm'
- name: Install FCM
run: |
# install FCM deps
sudo apt-get install -y \
subversion \
build-essential \
gfortran \
libxml-parser-perl \
libconfig-inifiles-perl \
libdbi-perl \
libdbd-sqlite3-perl
# install wandisco
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu \
`lsb_release -cs` svn19" \
>> /etc/apt/sources.list.d/subversion19.list'
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- \
| sudo apt-key add -
# prepend FCM bin to $PATH
FCM_PATH="$GITHUB_WORKSPACE/fcm/bin"
# the github actions way (needed for cylc jobs)
echo "$FCM_PATH" >> "${GITHUB_PATH}"
# the bashrc way (needed for subsequent gh action steps)
echo "export PATH=\"$FCM_PATH:\$PATH\"" >> "$HOME/.bashrc"
- name: Test
run: |
pytest -n 5 tests/
- name: Doctest
run: |
# note: not configuring this via a pytest.ini file
# due to strange behaviour when using --doctest-modules
# in the tests/ directory
pytest --doctest-modules cylc/
- name: Coverage report
run: |
coverage xml
coverage report
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: '${{ github.workflow }} py-${{ matrix.python-version }}'
fail_ci_if_error: false