Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick GH Actions changes from master #2769

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 48 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,46 @@ defaults:
shell: bash # macos default shell is zsh

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.rose_ref || github.sha }}

- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Apt-Get Install
run: |
sudo apt-get update
sudo apt-get install -y shellcheck

- name: Install Rose
run: |
pip install ."[lint]"
yarn install

- name: Flake8
run: flake8

- name: Shellchecker
run: etc/bin/shellchecker

- name: ESLint
run: yarn run lint

- name: MyPy
run: |
mypy


test:
needs: lint
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
Expand All @@ -51,13 +90,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.rose_ref || github.sha }}
path: rose

- name: Configure Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -69,7 +108,6 @@ jobs:
bash \
coreutils \
gnu-sed \
shellcheck \
sqlite3 \
subversion \
graphviz
Expand Down Expand Up @@ -120,7 +158,7 @@ jobs:

- name: Checkout FCM
if: startsWith(matrix.os, 'ubuntu')
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.fcm_repo || 'metomi/fcm' }}
ref: ${{ inputs.fcm_ref || 'master' }}
Expand Down Expand Up @@ -153,20 +191,6 @@ jobs:
# the bashrc wat (needed for subsequent gh action steps)
echo "export PATH=\"$FCM_PATH:\$PATH\"" >> "$HOME/.bashrc"

- name: Style
if: startsWith(matrix.os, 'ubuntu')
working-directory: rose
run: |
flake8
etc/bin/shellchecker
yarn run lint

- name: MyPy
if: startsWith(matrix.os, 'ubuntu')
working-directory: rose
run: |
mypy

- name: Unit Tests
working-directory: rose
run: |
Expand Down Expand Up @@ -194,24 +218,25 @@ jobs:

- name: Upload cylc-run artifact
if: failure() && steps.functest.outcome == 'failure'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cylc-run ${{ matrix.os }}
name: cylc-run ${{ matrix.os }} py-${{ matrix.python-version }}
path: ~/cylc-run/

docs:
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.rose_ref || github.sha }}

- name: Configure Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.9

- name: install graphviz
run: |
Expand Down
13 changes: 8 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ install_requires =
metomi-isodatetime==1!3.*
psutil>=5.6.0
requests
setuptools>=49, <67
sqlalchemy==1.*

[options.packages.find]
Expand All @@ -70,7 +71,6 @@ include = metomi*
docs =
cylc-sphinx-extensions[all]>=1.2.0
hieroglyph>=2.1.0
setuptools>=49
sphinx
sphinx_rtd_theme
sphinxcontrib-httpdomain
Expand All @@ -80,15 +80,18 @@ graph =
rosa =
tests =
aiosmtpd
flake8>=4.0.0
mypy>=0.800
pytest
types-aiofiles
types-setuptools
# Note: some tests also depend on cylc-rose which has to be the
# development version installed manually (because the latest production
# version is pinned to the previous rose release)
lint =
flake8>=4.0.0
flake8-type-checking; python_version > "3.7"
mypy>=0.800
types-aiofiles
types-setuptools
all =
%(lint)s
%(docs)s
%(graph)s
%(rosa)s
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ ignore=
E731,
# no longer best practice:
W503
per-file-ignores=
# Ignore suggestion for TYPE_CHECKING block in tests:
metomi/*/tests/*: TC003
Loading