Skip to content

Commit 8c34e8a

Browse files
authored
selftest: run some selftests on Windows (#44)
1 parent 530374b commit 8c34e8a

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: actions/setup-python@v4
1515
with:
16-
python-version: "3.7"
16+
python-version: "3.x"
1717
- name: lint
1818
run: make lint

.github/workflows/selftest.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ on:
77
pull_request:
88
workflow_dispatch:
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
selftest-requirements:
12-
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest]
19+
runs-on: ${{ matrix.os }}
1320
steps:
1421
- uses: actions/checkout@v3
1522
- uses: ./
@@ -21,6 +28,7 @@ jobs:
2128
# explicitly uses a vulnerable requirements file.
2229
internal-be-careful-allow-failure: true
2330
- name: assert expected output
31+
shell: bash
2432
env:
2533
PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}"
2634
run: |
@@ -88,6 +96,7 @@ jobs:
8896
PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}"
8997
run: |
9098
grep -E 'pyyaml\s+\|\s+5.1' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}")
99+
91100
selftest-pipaudit-fail:
92101
runs-on: ubuntu-latest
93102
steps:
@@ -106,3 +115,22 @@ jobs:
106115
PIP_AUDIT_OUTPUT: "${{ steps.pip-audit.outputs.internal-be-careful-output }}"
107116
run: |
108117
grep 'pip-audit did not return any output' <<< $(base64 -d <<< "${PIP_AUDIT_OUTPUT}")
118+
119+
all-selftests-pass:
120+
if: always()
121+
122+
needs:
123+
- selftest-requirements
124+
- selftest-environment
125+
- selftest-virtualenv
126+
- selftest-pyproject
127+
- selftest-pipaudit-fail
128+
129+
runs-on: ubuntu-latest
130+
131+
steps:
132+
- name: check test jobs
133+
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
134+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
135+
with:
136+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)