Skip to content

Commit b58e985

Browse files
authored
ci: split workflows into own modules (#37)
* ci: split workflows into own modules * ci: add other workflows * ci: launch other workflows * ci: add missing release file * ci: remove inter workflow dependencies
1 parent eccf428 commit b58e985

8 files changed

Lines changed: 286 additions & 242 deletions

File tree

.github/workflows/ci_check_release.yml

Lines changed: 0 additions & 242 deletions
This file was deleted.

.github/workflows/format.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Format
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.12'
17+
18+
- name: Restore Poetry Cache
19+
uses: actions/cache@v4
20+
with:
21+
path: |
22+
~/.cache/pypoetry
23+
~/.poetry
24+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
25+
26+
- name: Install Poetry
27+
run: |
28+
pip install poetry
29+
30+
- name: Run Ruff Formatting
31+
run: |
32+
poetry run ruff format --config pyproject.toml src/

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.12'
17+
18+
- name: Restore Poetry Cache
19+
uses: actions/cache@v4
20+
with:
21+
path: |
22+
~/.cache/pypoetry
23+
~/.poetry
24+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
25+
26+
- name: Install Poetry
27+
run: |
28+
pip install poetry
29+
30+
- name: Run Ruff Linting
31+
run: |
32+
poetry run ruff check --config pyproject.toml src/

.github/workflows/main.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
9+
jobs:
10+
setup:
11+
uses: ./.github/workflows/setup.yml
12+
13+
format:
14+
needs: setup
15+
uses: ./.github/workflows/format.yml
16+
17+
lint:
18+
needs: format
19+
uses: ./.github/workflows/lint.yml
20+
21+
type-check:
22+
needs: format
23+
uses: ./.github/workflows/type-check.yml
24+
25+
test:
26+
needs: setup
27+
uses: ./.github/workflows/test.yml
28+
29+
create_release:
30+
if: github.ref == 'refs/heads/main'
31+
needs: [ lint, type-check, test ]
32+
uses: ./.github/workflows/release.yml

0 commit comments

Comments
 (0)