Skip to content

Commit 3af0442

Browse files
authored
ci: Unify Python testing GHA job steps (VirusTotal#677)
Setting `bash` is available in all the VM runtimes making it easy to have fewer branches on the YAML definition level [[1]]. [1]: https://docs.zizmor.sh/audits/#template-injection
1 parent ceb06cd commit 3af0442

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

.github/workflows/python.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,21 @@ jobs:
1717
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
1818
os: [ ubuntu-latest, macos-latest, windows-latest ]
1919
runs-on: ${{ matrix.os }}
20+
defaults:
21+
run:
22+
shell: bash --noprofile --norc -eEuo pipefail {0}
2023
steps:
2124
- name: Checkout
2225
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2326
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2427
with:
2528
python-version: ${{ matrix.python-version }}
2629

27-
- name: Test Python - Windows
28-
if: runner.os == 'Windows'
29-
run: |
30-
pip install virtualenv
31-
virtualenv venv; venv\Scripts\activate.ps1
32-
pwd
33-
python -m pip install --upgrade pip maturin>=1.7.8
34-
python -m pip install pytest
35-
maturin develop --manifest-path py/Cargo.toml --features=test_proto2-module,test_proto3-module
36-
pytest py
37-
38-
# Non-windows
39-
- name: Test Python - Non-Windows
40-
if: runner.os != 'Windows'
30+
- name: Test Python
4131
run: |
4232
pip install virtualenv
4333
virtualenv venv; source venv/bin/activate
4434
python -m pip install --upgrade pip maturin>=1.7.8
4535
python -m pip install pytest
4636
maturin develop --manifest-path py/Cargo.toml --features=test_proto2-module,test_proto3-module
4737
pytest py
48-

0 commit comments

Comments
 (0)