forked from castai/k8s-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.85 KB
/
pull_request.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
name: Test
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-
- name: Build E2E Go binary
run: |
cd ./e2e
go build -ldflags "-s -w" -o bin/conformance .
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
- name: Run golangci-lint
# You may pin to the exact commit or the version.
# uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc
uses: golangci/[email protected]
with:
# the token is used for fetching patch of a pull request to show only new issues
github-token: ${{ github.token }}
# if set to true and the action runs on a pull request - the action outputs only newly found issues
only-new-issues: true
- name: Test
run: go test -race ./...
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./e2e
push: true
tags: ghcr.io/EmilyShepherd/k8s-client-go/conformance:${{ github.sha }}
- name: Create k8s cluster
uses: helm/[email protected]
- name: Run tests
run: |
cd ./e2e
IMG=ghcr.io/EmilyShepherd/k8s-client-go/conformance:${{ github.sha }} ./run.sh