Merge pull request #638 from cylc/1.5.x-sync #1056
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
name: Test | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- '*.*.x' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 2 | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest'] | |
python: ['3.8', '3.9'] | |
include: | |
- os: 'macos-latest' | |
python: '3.9' | |
env: | |
PYTEST_ADDOPTS: --cov --color=yes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Brew Install | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
# install system deps | |
brew update | |
brew install bash coreutils | |
# add GNU coreutils to the user PATH | |
# (see instructions in brew install output) | |
echo \ | |
"$(brew --prefix)/opt/coreutils/libexec/gnubin" \ | |
>> "${GITHUB_PATH}" | |
# add coreutils to the bashrc too (for jobs) | |
cat >> "${HOME}/.bashrc" <<__HERE__ | |
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH" | |
export PATH | |
__HERE__ | |
- name: Patch DNS | |
uses: cylc/release-actions/patch-dns@v1 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: install cylc-flow | |
uses: cylc/release-actions/install-cylc-components@v1 | |
with: | |
cylc_flow: true | |
cylc_flow_opts: '' | |
- name: install cylc-uiserver | |
run: pip install -e .[all] | |
- name: Style test | |
if: startsWith(matrix.os, 'ubuntu') | |
run: flake8 | |
- name: Type checking | |
if: startsWith(matrix.os, 'ubuntu') | |
run: mypy | |
- name: Check changelog | |
uses: cylc/release-actions/towncrier-draft@v1 | |
- name: Test | |
run: pytest | |
- name: Coverage report | |
run: | | |
coverage xml --ignore-errors | |
coverage report | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_${{ matrix.os }}_py-${{ matrix.python }} | |
path: coverage.xml | |
retention-days: 4 | |
codecov: | |
needs: test | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download coverage artifacts | |
uses: actions/download-artifact@v4 | |
- name: Codecov upload | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ github.workflow }} | |
fail_ci_if_error: true | |
verbose: true | |
# Token not required for public repos, but avoids upload failure due | |
# to rate-limiting (but not for PRs opened from forks) | |
token: ${{ secrets.CODECOV_TOKEN }} |