-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (68 loc) · 1.98 KB
/
e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: "e2e test"
on:
push:
branches: [ main ]
paths-ignore:
- "example/**"
- "docs/**"
- "README.md"
pull_request:
branches: [ main ]
# Do not run when the change only includes these directories.
paths-ignore:
- "example/**"
- "docs/**"
- "README.md"
jobs:
# Build the jaguar and cache it so the workers can get it.
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
id: go
# Look for a CLI that's made for this PR
- name: Fetch built CLI
id: cli-cache
uses: actions/cache@v4
with:
path: ./_output/linux/amd64/bin/jaguar
# The cache key a combination of the current PR number and the commit SHA
key: jaguar-${{ github.event.pull_request.number }}-${{ github.sha }}
- name: Fetch cached go modules
uses: actions/cache@v4
if: steps.cli-cache.outputs.cache-hit != 'true'
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Check out the code
uses: actions/checkout@v4
if: steps.cli-cache.outputs.cache-hit != 'true'
# If no binaries were built for this PR, build it now.
- name: Build CLI
if: steps.cli-cache.outputs.cache-hit != 'true'
run: |
make build
run-e2e-test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Check out the code
uses: actions/checkout@v4
- name: Fetch built CLI
id: cli-cache
uses: actions/cache@v4
with:
path: ./_output/linux/amd64/bin/jaguar
key: jaguar-${{ github.event.pull_request.number }}-${{ github.sha }}
- name: Run E2E test
run: |
GOPATH=~/go make e2e