Skip to content

Commit 87e73a4

Browse files
authored
chore: add support for cache to speed up the CI (#1106)
1 parent 1207fa7 commit 87e73a4

File tree

3 files changed

+27
-31
lines changed

3 files changed

+27
-31
lines changed

.github/workflows/checks.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ jobs:
2121
working-directory: ${{ matrix.lib }}
2222
steps:
2323
- uses: actions/checkout@v4
24+
- name: Install poetry
25+
run: pipx install poetry
2426
- name: Set up Python
2527
uses: actions/setup-python@v5
2628
with:
2729
python-version: ${{ matrix.python-version }}
28-
- name: Install poetry
29-
run: |
30-
pip install poetry
31-
poetry --version
30+
cache: "poetry"
3231
- name: Install dependencies and library
3332
run: poetry install
3433
- name: Check format
@@ -47,14 +46,13 @@ jobs:
4746
working-directory: ${{ matrix.lib }}
4847
steps:
4948
- uses: actions/checkout@v4
49+
- name: Install poetry
50+
run: pipx install poetry
5051
- name: Set up Python
5152
uses: actions/setup-python@v5
5253
with:
5354
python-version: ${{ matrix.python-version }}
54-
- name: Install poetry
55-
run: |
56-
pip install poetry
57-
poetry --version
55+
cache: "poetry"
5856
- name: Install dependencies and library
5957
run: poetry install
6058
- name: Check typing
@@ -73,14 +71,13 @@ jobs:
7371
working-directory: ${{ matrix.lib }}
7472
steps:
7573
- uses: actions/checkout@v4
74+
- name: Install poetry
75+
run: pipx install poetry
7676
- name: Set up Python
7777
uses: actions/setup-python@v5
7878
with:
7979
python-version: ${{ matrix.python-version }}
80-
- name: Install poetry
81-
run: |
82-
pip install poetry
83-
poetry --version
80+
cache: "poetry"
8481
- name: Install dependencies and library
8582
run: poetry install
8683
# We ignore the following rules for now:
@@ -102,14 +99,13 @@ jobs:
10299
working-directory: ${{ matrix.lib }}
103100
steps:
104101
- uses: actions/checkout@v4
102+
- name: Install poetry
103+
run: pipx install poetry
105104
- name: Set up Python
106105
uses: actions/setup-python@v5
107106
with:
108107
python-version: ${{ matrix.python-version }}
109-
- name: Install poetry
110-
run: |
111-
pip install poetry
112-
poetry --version
108+
cache: "poetry"
113109
- name: Install dependencies and library
114110
run: poetry install
115111
- name: Run tests

.github/workflows/docs.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
merge_group:
97
workflow_dispatch:
108

119
jobs:
@@ -16,14 +14,18 @@ jobs:
1614
working-directory: ./docs
1715
steps:
1816
- uses: actions/checkout@v4
17+
- name: Install poetry
18+
run: pipx install poetry
1919
- name: Set up Python
2020
uses: actions/setup-python@v5
2121
with:
22-
python-version: "3.10"
23-
- name: Install poetry
24-
run: |
25-
pip install poetry
26-
poetry --version
22+
python-version: "3.13"
23+
cache: 'poetry'
24+
- name: Set up cache
25+
uses: actions/cache@v4
26+
with:
27+
path: ./source
28+
key: 'sphinx-source-cache'
2729
- name: Install dependencies and library
2830
run: poetry install --no-root
2931
- name: Generate documentation sources

.github/workflows/release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ jobs:
1212
working-directory: scaleway-core
1313
steps:
1414
- uses: actions/checkout@v4
15+
- name: Install poetry
16+
run: pipx install poetry
1517
- name: Set up Python
1618
uses: actions/setup-python@v5
1719
with:
1820
python-version: "3.10"
19-
- name: Install poetry
20-
run: |
21-
pip install poetry
22-
poetry --version
21+
cache: "poetry"
2322
- name: Update lock file
2423
run: poetry lock
2524
- name: Install dependencies and library
@@ -49,14 +48,13 @@ jobs:
4948
working-directory: ${{ matrix.lib }}
5049
steps:
5150
- uses: actions/checkout@v4
51+
- name: Install poetry
52+
run: pipx install poetry
5253
- name: Set up Python
5354
uses: actions/setup-python@v5
5455
with:
5556
python-version: "3.10"
56-
- name: Install poetry
57-
run: |
58-
pip install poetry
59-
poetry --version
57+
cache: "poetry"
6058
- name: Set local scaleway-core version
6159
run: poetry version $(echo "${{ github.ref }}" | cut -d "/" -f 3)
6260
working-directory: scaleway-core

0 commit comments

Comments
 (0)