Skip to content

Commit d3a4eb8

Browse files
committed
simplify workflows
1 parent d665420 commit d3a4eb8

File tree

2 files changed

+43
-118
lines changed

2 files changed

+43
-118
lines changed

.github/workflows/affected.yaml

-60
This file was deleted.

.github/workflows/test.yaml

+43-58
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,56 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: 🪿
15+
name: PR
1616

1717
on:
18-
workflow_run:
19-
workflows: ["PR"]
20-
types: ["completed"]
18+
push:
19+
branches: main
20+
pull_request:
21+
22+
env:
23+
PROJECT: jss-22p1-test
24+
WORKLOAD_IDENTITY_PROVIDER: projects/886556137211/locations/global/workloadIdentityPools/github-actions/providers/github-actions-python
2125

2226
jobs:
23-
test:
27+
affected:
28+
name: Finding affected tests
2429
runs-on: ubuntu-latest
30+
outputs:
31+
python: ${{ steps.python.outputs.affected }}
2532
steps:
26-
- run: echo "Running tests"
27-
28-
# on:
29-
# push:
30-
# branches: main
31-
# pull_request:
32-
# workflow_dispatch: # Manual runs
33-
34-
# env:
35-
# PROJECT: jss-22p1-test
36-
# WORKLOAD_IDENTITY_PROVIDER: projects/886556137211/locations/global/workloadIdentityPools/github-actions/providers/github-actions-python
37-
38-
# jobs:
39-
# affected:
40-
# name: Finding affected tests
41-
# runs-on: ubuntu-latest
42-
# outputs:
43-
# python: ${{steps.python.outputs.affected}}
44-
# defaults:
45-
# run:
46-
# working-directory: .github/testing
47-
# steps:
48-
# - uses: actions/checkout@v4
49-
# with:
50-
# fetch-depth: 0
51-
# - uses: oven-sh/setup-bun@v2
52-
# - run: bun install
53-
# - id: python
54-
# run: |
55-
# AFFECTED_PYTHON=$(bun run affected python HEAD origin/main)
56-
# echo "$AFFECTED_PYTHON"
57-
# echo "affected=$AFFECTED_PYTHON" >> "$GITHUB_OUTPUT"
33+
- uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
- uses: actions/setup-go@v5
37+
with:
38+
go-version: ^1.23.0
39+
- run: go version
40+
- run: go install github.com/davidcavazos/testing-infra/cmd/[email protected]
41+
- id: python
42+
run: |
43+
PYTHON=$(affected .github/workflows/config/python.json)
44+
echo "$PYTHON"
45+
echo "affected=$PYTHON" >> "$GITHUB_OUTPUT"
5846
59-
# python-lint:
60-
# name: Lint Python
61-
# needs: affected
62-
# runs-on: ubuntu-latest
63-
# strategy:
64-
# matrix:
65-
# affected: ${{fromJson(needs.affected.outputs.python)}}
66-
# defaults:
67-
# run:
68-
# working-directory: .github/testing
69-
# steps:
70-
# - uses: actions/checkout@v4
71-
# - uses: oven-sh/setup-bun@v2
72-
# - uses: actions/setup-python@v5
73-
# with:
74-
# python-version: '3.12'
75-
# - run: pip install nox
76-
# - run: bun install
77-
# - run: bun run ci-lint python AFFECTED
78-
# env:
79-
# AFFECTED: ${{toJson(matrix.affected)}}
47+
python-lint:
48+
name: Lint Python
49+
needs: affected
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
affected: ${{ fromJson(needs.affected.outputs.python) }}
54+
env:
55+
PACKAGE: ${{ toJson(matrix.affected.packages) }}
56+
steps:
57+
- uses: actions/checkout@v4
58+
- uses: actions/setup-python@v5
59+
with:
60+
python-version: '3.12'
61+
- run: pip install nox
62+
- run: echo "$PACKAGE"
63+
- working-directory: ${{ env.PACKAGE }}
64+
run: nox -s lint
8065

8166
# python-test:
8267
# name: Test Python

0 commit comments

Comments
 (0)