Skip to content

Commit 0c65397

Browse files
committed
build: simplify github action workflows
1 parent 16e2433 commit 0c65397

File tree

3 files changed

+15
-80
lines changed

3 files changed

+15
-80
lines changed

.github/workflows/docs.yaml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,19 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@master
13+
- name: fetch code
14+
uses: actions/checkout@master
1415

15-
- name: install hunspell-en-gb
16+
- name: install en-gb dictionary
1617
run: sudo apt-get install -y hunspell-en-gb
1718

1819
- name: set python version
1920
uses: actions/setup-python@v4
2021
with:
2122
python-version: "3.10"
2223

23-
- name: install poetry
24-
run: |
25-
curl -sSL https://install.python-poetry.org | python - --preview
26-
27-
- name: Update PATH
28-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
29-
30-
- name: configure poetry
31-
run: poetry config virtualenvs.in-project true
32-
33-
- name: set up python cache
34-
uses: actions/cache@v3
35-
id: python-cache
36-
with:
37-
path: .venv
38-
key: venv-${{ hashFiles('**/poetry.lock') }}
39-
40-
- name: ensure cache is healthy
41-
if: steps.python-cache.outputs.cache-hit == 'true'
42-
run: timeout 10s poetry run pip --version || rm -rf .venv
43-
44-
- name: install python dependencies
45-
if: steps.python-cache.outputs.cache-hit != 'true'
46-
run: poetry install
24+
- name: install dependencies
25+
uses: artisanal-actions/poetry-install@v1
4726

4827
- name: build docs
4928
run: make build docs

.github/workflows/release-please.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
release-type: python
1919
package-name: ${{ env.PACKAGE_NAME }}
2020

21-
- uses: actions/checkout@v2
21+
- name: fetch code
22+
uses: actions/checkout@v2
2223
if: ${{ steps.release.outputs.release_created }}
2324

2425
- name: set python version
@@ -27,34 +28,9 @@ jobs:
2728
with:
2829
python-version: "3.10"
2930

30-
- name: install poetry
31+
- name: install dependencies
32+
uses: artisanal-actions/poetry-install@v1
3133
if: ${{ steps.release.outputs.release_created }}
32-
run: |
33-
curl -sSL https://install.python-poetry.org | python - --preview
34-
35-
- name: Update PATH
36-
if: ${{ steps.release.outputs.release_created }}
37-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
38-
39-
- name: configure poetry
40-
if: ${{ steps.release.outputs.release_created }}
41-
run: poetry config virtualenvs.in-project true
42-
43-
- name: set up python cache
44-
if: ${{ steps.release.outputs.release_created }}
45-
uses: actions/cache@v3
46-
id: python-cache
47-
with:
48-
path: .venv
49-
key: venv-${{ hashFiles('**/poetry.lock') }}
50-
51-
- name: ensure cache is healthy
52-
if: ${{ steps.python-cache.outputs.cache-hit == 'true' && steps.release.outputs.release_created }}
53-
run: timeout 10s poetry run pip --version || rm -rf .venv
54-
55-
- name: install python dependencies
56-
if: ${{ steps.python-cache.outputs.cache-hit != 'true' && steps.release.outputs.release_created }}
57-
run: poetry install
5834

5935
- name: build release
6036
if: ${{ steps.release.outputs.release_created }}

.github/workflows/tests.yaml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,21 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@master
20+
- name: fetch code
21+
uses: actions/checkout@master
2122

22-
- name: install hunspell-en-gb
23+
- name: install en-gb dictionary
2324
run: sudo apt-get install -y hunspell-en-gb
2425

2526
- name: set python version
2627
uses: actions/setup-python@v4
2728
with:
2829
python-version: "3.10"
2930

30-
- name: install poetry
31-
run: |
32-
curl -sSL https://install.python-poetry.org | python - --preview
33-
- name: Update PATH
34-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
31+
- name: install dependencies
32+
uses: artisanal-actions/poetry-install@v1
3533

36-
- name: configure poetry
37-
run: poetry config virtualenvs.in-project true
38-
39-
- name: set up python cache
40-
uses: actions/cache@v3
41-
id: python-cache
42-
with:
43-
path: .venv
44-
key: venv-${{ hashFiles('**/poetry.lock') }}
45-
46-
- name: ensure cache is healthy
47-
if: steps.python-cache.outputs.cache-hit == 'true'
48-
run: timeout 10s poetry run pip --version || rm -rf .venv
49-
50-
- name: install python dependencies
51-
if: steps.python-cache.outputs.cache-hit != 'true'
52-
run: poetry install
53-
54-
- name: Install pytest plugin
34+
- name: install pytest plugin
5535
run: poetry run pip install pytest-github-actions-annotate-failures
5636

5737
- name: run tests

0 commit comments

Comments
 (0)