Skip to content

Commit

Permalink
misc[gha]: split jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
peshence committed Jan 15, 2025
1 parent 360fe7f commit e1cc96e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 34 deletions.
44 changes: 10 additions & 34 deletions .github/workflows/check-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,28 @@
name: Check and publish

on:

push:
branches:
- '**'
- 'develop'
- 'master'
- 'main'
tags:
- '**'

# pull_request: ~
pull_request:
branches:
- 'master'
- 'main'

workflow_dispatch: ~

jobs:

quality:
name: Code QA
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: pip install black flake8 isort
- run: black --version
- run: isort --check .
- run: black --check .
- run: flake8 .
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytest tests/unit
docs:
if: |
(github.event_name == 'push' && contains(github.ref, 'refs/tags/')) ||
github.ref == 'refs/heads/master'
name: Build Readthedocs
runs-on: ubuntu-latest
steps:
- name: Start polytope-docs build
uses: actions/github-script@v4
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_REPO_READ_TOKEN }}
script: |-
Expand All @@ -64,9 +40,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Start polytope-docs build
uses: actions/github-script@v4
uses: actions/github-script@v7
with:
github-token: ${{ secrets.ECMWF_REPO_ACCESS }}
github-token: ${{ secrets.GH_REPO_READ_TOKEN }}
script: |-
await github.actions.createWorkflowDispatch({
owner: 'ecmwf-projects',
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Code quality and unit tests

on:
push:
branches:
- '**'
tags:
- '**'

# pull_request: ~

workflow_dispatch: ~

jobs:
quality:
name: Code QA
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install black flake8 isort
- run: black --version
- run: isort --check .
- run: black --check .
- run: flake8 .
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytest tests/unit

0 comments on commit e1cc96e

Please sign in to comment.