Skip to content

Commit 195b573

Browse files
committed
split out workflows
1 parent 0c495a8 commit 195b573

File tree

2 files changed

+120
-57
lines changed

2 files changed

+120
-57
lines changed

.github/workflows/build_test_ci.yml

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Test CI
1+
name: Coverage and E2E
22

33
on:
44
push:
@@ -39,17 +39,6 @@ jobs:
3939
with:
4040
filters: .github/filters.yml
4141

42-
yamllint:
43-
runs-on: ubuntu-latest
44-
needs: changes
45-
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
46-
steps:
47-
- uses: actions/checkout@v4
48-
with:
49-
ref: ${{ github.event.pull_request.head.sha }}
50-
- name: Validate YAML file
51-
run: yamllint templates
52-
5342
go-build-test:
5443
environment: ${{ github.event.pull_request.head.repo.fork == true && 'prod-external' || 'prod' }}
5544
runs-on: ubuntu-latest
@@ -84,12 +73,6 @@ jobs:
8473
go-version-file: 'go.mod'
8574
check-latest: true
8675

87-
- name: Build
88-
run: make build
89-
90-
- name: Check for generated diff
91-
run: make check-gen-diff
92-
9376
- name: Test
9477
run: make test
9578

@@ -118,42 +101,3 @@ jobs:
118101
with:
119102
e2e-selector: ${{ matrix.flavor }}
120103
e2e-flags: ${{ matrix.flavor == 'quick' && '' || '--assert-timeout 20m0s'}}
121-
122-
123-
docker-build:
124-
runs-on: ubuntu-latest
125-
environment: ${{ github.event.pull_request.head.repo.fork == true && 'prod-external' || 'prod' }}
126-
needs: changes
127-
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
128-
steps:
129-
- name: Harden Runner
130-
uses: step-security/harden-runner@v2
131-
with:
132-
disable-sudo: true
133-
egress-policy: block
134-
allowed-endpoints: >
135-
api.github.com:443
136-
github.com:443
137-
proxy.golang.org:443
138-
sum.golang.org:443
139-
go.dev:443
140-
dl.google.com:443
141-
golang.org:443
142-
objects.githubusercontent.com:443
143-
registry-1.docker.io:443
144-
auth.docker.io:443
145-
production.cloudflare.docker.com:443
146-
gcr.io:443
147-
storage.googleapis.com:443
148-
149-
- uses: actions/checkout@v4
150-
with:
151-
ref: ${{ github.event.pull_request.head.sha }}
152-
153-
- name: Docker cache
154-
uses: ScribeMD/docker-cache@0.5.0
155-
with:
156-
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}
157-
158-
- name: Build the Docker image
159-
run: make docker-build
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build and Test PR
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
actions: read
11+
12+
concurrency:
13+
group: pull-request-ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
changes:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
# Expose matched filters as job 'src' output variable
21+
paths: ${{ steps.filter.outputs.changes }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Harden Runner
25+
uses: step-security/harden-runner@v2
26+
with:
27+
disable-sudo: true
28+
egress-policy: block
29+
allowed-endpoints: >
30+
api.github.com:443
31+
github.com:443
32+
- uses: dorny/paths-filter@v3
33+
id: filter
34+
with:
35+
filters: .github/filters.yml
36+
37+
yamllint:
38+
runs-on: ubuntu-latest
39+
needs: changes
40+
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Validate YAML file
44+
run: yamllint templates
45+
46+
go-build-test:
47+
runs-on: ubuntu-latest
48+
needs: changes
49+
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
50+
steps:
51+
- name: Harden Runner
52+
uses: step-security/harden-runner@v2
53+
with:
54+
disable-sudo: true
55+
egress-policy: block
56+
allowed-endpoints: >
57+
api.github.com:443
58+
github.com:443
59+
golang.org:443
60+
proxy.golang.org:443
61+
sum.golang.org:443
62+
objects.githubusercontent.com:443
63+
storage.googleapis.com:443
64+
cli.codecov.io:443
65+
api.codecov.io:443
66+
ingest.codecov.io:443
67+
raw.githubusercontent.com:443
68+
69+
- uses: actions/checkout@v4
70+
71+
- name: Set up Go
72+
uses: actions/setup-go@v5
73+
with:
74+
go-version-file: 'go.mod'
75+
check-latest: true
76+
77+
- name: Build
78+
run: make build
79+
80+
- name: Check for generated diff
81+
run: make check-gen-diff
82+
83+
- name: Test
84+
run: make test
85+
86+
docker-build:
87+
runs-on: ubuntu-latest
88+
needs: changes
89+
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
90+
steps:
91+
- name: Harden Runner
92+
uses: step-security/harden-runner@v2
93+
with:
94+
disable-sudo: true
95+
egress-policy: block
96+
allowed-endpoints: >
97+
api.github.com:443
98+
github.com:443
99+
proxy.golang.org:443
100+
sum.golang.org:443
101+
go.dev:443
102+
dl.google.com:443
103+
golang.org:443
104+
objects.githubusercontent.com:443
105+
registry-1.docker.io:443
106+
auth.docker.io:443
107+
production.cloudflare.docker.com:443
108+
gcr.io:443
109+
storage.googleapis.com:443
110+
111+
- uses: actions/checkout@v4
112+
113+
- name: Docker cache
114+
uses: ScribeMD/docker-cache@0.5.0
115+
with:
116+
key: docker-${{ runner.os }}-${{ hashFiles('go.sum') }}
117+
118+
- name: Build the Docker image
119+
run: make docker-build

0 commit comments

Comments
 (0)