Skip to content

Commit

Permalink
GH Actions: added a lint task to test workflow (#2761)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim authored Feb 8, 2024
1 parent 9d7f0a6 commit 009b1e5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 20 deletions.
57 changes: 41 additions & 16 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 Down Expand Up @@ -69,7 +108,6 @@ jobs:
bash \
coreutils \
gnu-sed \
shellcheck \
sqlite3 \
subversion \
graphviz
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 @@ -200,6 +224,7 @@ jobs:
path: ~/cylc-run/

docs:
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -211,7 +236,7 @@ jobs:
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.9

- name: install graphviz
run: |
Expand Down
10 changes: 6 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,18 @@ graph =
rosa =
tests =
aiosmtpd
pytest
# 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
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)
all =
%(lint)s
%(docs)s
%(graph)s
%(rosa)s
Expand Down

0 comments on commit 009b1e5

Please sign in to comment.