7
7
branches : ["master"]
8
8
workflow_dispatch : # to allow manual re-runs
9
9
10
+ env :
11
+ POETRY_VERSION : 1.8.2
10
12
11
13
jobs :
12
14
linting :
@@ -19,35 +21,13 @@ jobs:
19
21
20
22
steps :
21
23
- uses : " actions/checkout@v4"
22
- - uses : " actions/setup-python@v5 "
23
- id : setup-python
24
+ - name : Setup environment
25
+ uses : ./.github/actions/ setup
24
26
with :
25
- python-version : " ${{ matrix.python-version }}"
26
- - name : Install poetry
27
- run : pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
28
- - name : Read poetry cache location
29
- id : poetry-cache-location
30
- shell : bash
31
- run : |
32
- echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
33
- - uses : actions/cache@v3
34
- name : Poetry cache
35
- with :
36
- path : |
37
- ${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
38
- key : ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}-extras-false
39
- - name : " Install dependencies"
40
- run : |
41
- poetry install
42
- - name : Read pre-commit version
43
- id : pre-commit-version
44
- run : >-
45
- echo "PRE_COMMIT_VERSION=$(poetry run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
46
- - uses : actions/cache@v3
47
- name : Pre-commit cache
48
- with :
49
- path : ~/.cache/pre-commit/
50
- key : ${{ runner.os }}-pre-commit-${{ steps.pre-commit-version.outputs.PRE_COMMIT_VERSION }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
27
+ os : ${{ matrix.os }}
28
+ python-version : ${{ matrix.python-version }}
29
+ cache-pre-commit : true
30
+ poetry-version : ${{ env.POETRY_VERSION }}
51
31
- name : " Check supported device md files are up to date"
52
32
run : |
53
33
poetry run pre-commit run generate-supported --all-files
@@ -108,31 +88,13 @@ jobs:
108
88
109
89
steps :
110
90
- uses : " actions/checkout@v4"
111
- - uses : " actions/setup-python@v5 "
112
- id : setup-python
91
+ - name : Setup environment
92
+ uses : ./.github/actions/ setup
113
93
with :
114
- python-version : " ${{ matrix.python-version }}"
115
- - name : Install poetry
116
- run : pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
117
- - name : Read poetry cache location
118
- id : poetry-cache-location
119
- shell : bash
120
- run : |
121
- echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
122
- - uses : actions/cache@v3
123
- name : Poetry cache
124
- with :
125
- path : |
126
- ${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
127
- key : ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}-extras-${{ matrix.extras }}
128
- - name : " Install dependencies (no extras)"
129
- if : matrix.extras == false
130
- run : |
131
- poetry install
132
- - name : " Install dependencies (with extras)"
133
- if : matrix.extras == true
134
- run : |
135
- poetry install --all-extras
94
+ os : ${{ matrix.os }}
95
+ python-version : ${{ matrix.python-version }}
96
+ poetry-version : ${{ env.POETRY_VERSION }}
97
+ poetry-install-options : ${{ matrix.extras == true && '--all-extras' || '' }}
136
98
- name : " Run tests (no coverage)"
137
99
if : ${{ startsWith(matrix.python-version, 'pypy') }}
138
100
run : |
0 commit comments