Skip to content

Commit f474703

Browse files
authored
chore: simplify format to run only in one version (#1108)
1 parent dc3746b commit f474703

File tree

4 files changed

+122
-80
lines changed

4 files changed

+122
-80
lines changed

.github/workflows/checks.yml

Lines changed: 6 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
name: Check Commit
1+
name: Tests
2+
3+
permissions:
4+
contents: read
5+
26
on:
37
push:
48
branches:
@@ -7,85 +11,6 @@ on:
711
merge_group:
812

913
jobs:
10-
format:
11-
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
lib:
15-
- scaleway-core
16-
- scaleway
17-
- scaleway-async
18-
python-version: ['3.10' ,'3.11', '3.12', '3.13']
19-
defaults:
20-
run:
21-
working-directory: ${{ matrix.lib }}
22-
steps:
23-
- uses: actions/checkout@v4
24-
- name: Install poetry
25-
run: pipx install poetry
26-
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
cache: "poetry"
31-
- name: Install dependencies and library
32-
run: poetry install
33-
- name: Check format
34-
run: poetry run ruff format --check
35-
36-
typing:
37-
runs-on: ubuntu-latest
38-
strategy:
39-
matrix:
40-
lib:
41-
- scaleway-core
42-
- scaleway
43-
- scaleway-async
44-
defaults:
45-
run:
46-
working-directory: ${{ matrix.lib }}
47-
steps:
48-
- uses: actions/checkout@v4
49-
- name: Install poetry
50-
run: pipx install poetry
51-
- name: Set up Python
52-
uses: actions/setup-python@v5
53-
with:
54-
python-version: ${{ matrix.python-version }}
55-
cache: "poetry"
56-
- name: Install dependencies and library
57-
run: poetry install
58-
- name: Check typing
59-
run: poetry run mypy --install-types --non-interactive --strict --no-warn-unused-ignores $(echo "${{ matrix.lib }}" | tr "-" "_")
60-
61-
linting:
62-
runs-on: ubuntu-latest
63-
strategy:
64-
matrix:
65-
lib:
66-
- scaleway-core
67-
- scaleway
68-
- scaleway-async
69-
defaults:
70-
run:
71-
working-directory: ${{ matrix.lib }}
72-
steps:
73-
- uses: actions/checkout@v4
74-
- name: Install poetry
75-
run: pipx install poetry
76-
- name: Set up Python
77-
uses: actions/setup-python@v5
78-
with:
79-
python-version: ${{ matrix.python-version }}
80-
cache: "poetry"
81-
- name: Install dependencies and library
82-
run: poetry install
83-
# We ignore the following rules for now:
84-
# E721 (https://docs.astral.sh/ruff/rules/type-comparison)
85-
# F541 (https://docs.astral.sh/ruff/rules/f-string-missing-placeholders)
86-
- name: Check linting
87-
run: poetry run ruff check . --ignore E721 --ignore F541
88-
8914
tests:
9015
runs-on: ubuntu-latest
9116
strategy:
@@ -94,6 +19,7 @@ jobs:
9419
- scaleway-core
9520
- scaleway
9621
- scaleway-async
22+
python-version: [ '3.10' ,'3.11', '3.12', '3.13' ]
9723
defaults:
9824
run:
9925
working-directory: ${{ matrix.lib }}

.github/workflows/format.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check formatting
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
merge_group:
12+
13+
jobs:
14+
ruff:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
lib:
19+
- scaleway-core
20+
- scaleway
21+
- scaleway-async
22+
defaults:
23+
run:
24+
working-directory: ${{ matrix.lib }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install poetry
28+
run: pipx install poetry
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.13'
33+
cache: "poetry"
34+
- name: Install dependencies and library
35+
run: poetry install
36+
- name: Check format
37+
run: poetry run ruff format --check

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check linters
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
merge_group:
12+
13+
jobs:
14+
ruff:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
lib:
19+
- scaleway-core
20+
- scaleway
21+
- scaleway-async
22+
python-version: [ '3.10' ,'3.11', '3.12', '3.13' ]
23+
defaults:
24+
run:
25+
working-directory: ${{ matrix.lib }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Install poetry
29+
run: pipx install poetry
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
cache: "poetry"
35+
- name: Install dependencies and library
36+
run: poetry install
37+
# We ignore the following rules for now:
38+
# E721 (https://docs.astral.sh/ruff/rules/type-comparison)
39+
# F541 (https://docs.astral.sh/ruff/rules/f-string-missing-placeholders)
40+
- name: Check linting
41+
run: poetry run ruff check . --ignore E721 --ignore F541

.github/workflows/typing.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Check type hinting
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
merge_group:
12+
13+
jobs:
14+
mypy:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
lib:
19+
- scaleway-core
20+
- scaleway
21+
- scaleway-async
22+
python-version: [ '3.10' ,'3.11', '3.12', '3.13' ]
23+
defaults:
24+
run:
25+
working-directory: ${{ matrix.lib }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Install poetry
29+
run: pipx install poetry
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
cache: "poetry"
35+
- name: Install dependencies and library
36+
run: poetry install
37+
- name: Check typing
38+
run: poetry run mypy --install-types --non-interactive --strict --no-warn-unused-ignores $(echo "${{ matrix.lib }}" | tr "-" "_")

0 commit comments

Comments
 (0)