Skip to content

Commit 8e3d259

Browse files
committed
Also testing with Ubuntu 22.04 within WSL (now only on demand and pull request).
1 parent 6b1a195 commit 8e3d259

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

.github/workflows/pre-commit_wsl.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: pre-commit
33
on:
44
workflow_dispatch:
55
pull_request:
6-
push:
7-
branches: [exec]
8-
paths-ignore:
9-
- 'constraints-*.txt'
6+
#push:
7+
# branches: [exec]
8+
# paths-ignore:
9+
# - 'constraints-*.txt'
1010

1111
jobs:
1212
pre-commit:
@@ -15,13 +15,16 @@ jobs:
1515
matrix:
1616
# python-version: [ "3.12" ]
1717
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
18-
name: Pre-commit WSL python ${{ matrix.python-version }}
18+
distribution: [ "Ubuntu-22.04", "Ubuntu-24.04" ]
19+
name: Pre-commit WSL python ${{ matrix.python-version }} dist ${{ matrix.distribution }}
1920
steps:
20-
- uses: Vampire/setup-wsl@v6
21+
- name: Bootstrapping dist ${{ matrix.distribution }}
22+
uses: Vampire/setup-wsl@v6
2123
with:
22-
distribution: Ubuntu-24.04
24+
distribution: ${{ matrix.distribution }}
2325
use-cache: 'true'
2426
update: 'true'
27+
wsl-shell-command: bash --norc -euo pipefail
2528
additional-packages: |
2629
python3
2730
python3-pip
@@ -59,7 +62,6 @@ jobs:
5962
- name: Install python ${{matrix.python-version}} using pyenv in WSL
6063
shell: wsl-bash {0}
6164
run: |
62-
source ~/.bash_profile
6365
pyenv install ${{matrix.python-version}}
6466
pyenv global ${{matrix.python-version}}
6567
- name: Clone repo
@@ -71,7 +73,6 @@ jobs:
7173
- name: 'Install requirements (standard or constraints ${{ matrix.python-version }})'
7274
shell: wsl-bash {0}
7375
run: |
74-
source ~/.bash_profile
7576
cd the_repo
7677
python -mvenv .env
7778
source .env/bin/activate
@@ -99,7 +100,6 @@ jobs:
99100
- name: 'Install development requirements'
100101
shell: wsl-bash {0}
101102
run: |
102-
source ~/.bash_profile
103103
cd the_repo
104104
source .env/bin/activate
105105
@@ -112,32 +112,31 @@ jobs:
112112
- name: 'pre-commit'
113113
shell: wsl-bash {0}
114114
run: |
115-
source ~/.bash_profile
116115
cd the_repo
117116
source .env/bin/activate
118117
119118
pre-commit run -a
120119
- name: 'pytest + coverage (${{ matrix.python-version }})'
121120
shell: wsl-bash {0}
122121
run: |
123-
source ~/.bash_profile
124122
cd the_repo
125123
source .env/bin/activate
126124
127125
pytest --cov=execution_process_metrics_collector
128126
- uses: actions/upload-artifact@v4
129127
with:
130-
name: wsl_pre-commit-${{ matrix.python-version }}
128+
name: wsl_pre-commit-${{ matrix.python-version }}-${{ matrix.distribution }}
131129
retention-days: 2
132-
path: the_repo/constraints-${{ matrix.python-version }}-wsl.txt
130+
path: the_repo/constraints-${{ matrix.python-version }}-wsl-${{ matrix.distribution }}.txt
133131

134132
check_licences:
135133
runs-on: ubuntu-latest
136134
strategy:
137135
matrix:
138136
# python-version: [ "3.12" ]
139137
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
140-
name: Validate licences of gathered dependencies (WSL python ${{ matrix.python-version }})
138+
distribution: [ "Ubuntu-22.04", "Ubuntu-24.04" ]
139+
name: Validate licences of gathered dependencies (WSL python ${{ matrix.python-version }} dist ${{ matrix.distribution }})
141140
needs:
142141
- pre-commit
143142
steps:
@@ -147,14 +146,14 @@ jobs:
147146
- uses: actions/download-artifact@v5
148147
id: download
149148
with:
150-
name: wsl_pre-commit-${{matrix.python-version}}
149+
name: wsl_pre-commit-${{matrix.python-version}}-${{ matrix.distribution }}
151150
- name: Get transitive dependencies licences
152151
id: license_check_print_report
153152
# uses: pilosus/action-pip-license-checker@v1.0.0
154153
# continue-on-error: true
155154
uses: pilosus/action-pip-license-checker@v3.1.0
156155
with:
157-
requirements: constraints-${{ matrix.python-version }}-wsl.txt
156+
requirements: constraints-${{ matrix.python-version }}-wsl-${{ matrix.distribution }}.txt
158157
# - name: Check transitive dependencies licences
159158
# id: license_check_report
160159
# uses: pilosus/action-pip-license-checker@v3.1.0
@@ -189,9 +188,9 @@ jobs:
189188
run: |
190189
skip=true
191190
if [ -d "${{steps.download.outputs.download-path}}" ] ; then
192-
for con in "${{steps.download.outputs.download-path}}"/constraints-*-wsl.txt ; do
191+
for con in "${{steps.download.outputs.download-path}}"/constraints-*-wsl-*.txt ; do
193192
case "$con" in
194-
*/constraints-\*-wsl.txt)
193+
*/constraints-\*-wsl-\*.txt)
195194
break
196195
;;
197196
*)
@@ -209,7 +208,7 @@ jobs:
209208
with:
210209
title: Updated WSL constraints (triggered on ${{ steps.timestamp.outputs.timestamp }} by ${{ github.sha }})
211210
branch: create-pull-request/patch-wsl_constraints
212-
add-paths: constraints-*-wsl.txt
211+
add-paths: constraints-*-wsl-*.txt
213212
delete-branch: true
214213
commit-message: "[create-pull-request] Automatically commit updated contents (constraints WSL)"
215214
- name: Check outputs

0 commit comments

Comments
 (0)