Skip to content

Commit da8a4e5

Browse files
committed
github workflow additions/updates
main addition is to run go-apidiff on all PRs also added go module caching, which should speed up tests and builds
1 parent 081c4b0 commit da8a4e5

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed

.github/workflows/e2e.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ jobs:
1111
e2e-kind:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
14+
15+
- uses: actions/checkout@v3
16+
1517
- uses: actions/setup-go@v3
1618
with:
17-
go-version-file: "go.mod"
19+
go-version-file: go.mod
20+
21+
- uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cache/go-build
25+
~/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
1830
- name: Run e2e tests
1931
run: |
2032
make e2e

.github/workflows/go-apidiff.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: go-apidiff
2+
on: [ pull_request ]
3+
jobs:
4+
go-apidiff:
5+
runs-on: ubuntu-latest
6+
steps:
7+
8+
- uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
12+
- uses: actions/setup-go@v3
13+
with:
14+
go-version-file: go.mod
15+
16+
- uses: actions/cache@v3
17+
with:
18+
path: |
19+
~/.cache/go-build
20+
~/go/pkg/mod
21+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
22+
restore-keys: |
23+
${{ runner.os }}-go-
24+
25+
- uses: joelanford/go-apidiff@main

.github/workflows/unit-test.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ jobs:
1111
unit-test-basic:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
14+
15+
- uses: actions/checkout@v3
16+
1517
- uses: actions/setup-go@v3
1618
with:
17-
go-version-file: "go.mod"
19+
go-version-file: go.mod
20+
21+
- uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cache/go-build
25+
~/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
1830
- name: Run basic unit tests
1931
run: |
2032
make test

0 commit comments

Comments
 (0)