-
Notifications
You must be signed in to change notification settings - Fork 8
90 lines (76 loc) · 2.44 KB
/
pull-request.yml
File metadata and controls
90 lines (76 loc) · 2.44 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: s2s-proxy PR Pipeline
on:
pull_request:
merge_group:
push:
branches:
- main
permissions:
contents: read
actions: write
# this ensures that the old run is abandoned when we have a new push to the PR branch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
name: lint - pull request
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Use setup-go with a custom read-only cache of what it creates, because we only want
# to cache builds from main to ensure we stay under the 10GB cache limit in GitHub while
# ensuring that PRs can use the cache from main.
#
# See https://github.com/actions/setup-go/issues/316 for more info.
- name: Install go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: ${{ github.ref == 'refs/heads/main' }} # only update the cache in main.
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.8
args: --build-tags=test_dep
build:
runs-on: ubuntu-latest
name: build and unittest - pull request
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: ${{ github.ref == 'refs/heads/main' }} # only update the cache in main.
- name: Run go build
run: make bins
- name: Run go unittest
run: make test
- name: Install helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.19.4
- name: Install helm-unittest
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git
- name: Run helm-unittest
working-directory: charts/s2s-proxy
run: helm unittest .
- name: Check Helm example.yaml is up to date
env:
EXAMPLE_FILE: "charts/s2s-proxy/example.yaml"
run: |
make helm-example
if git diff --color --exit-code -- "$EXAMPLE_FILE"; then
echo "Success: $EXAMPLE_FILE is up to date"
else
echo "ERROR: $EXAMPLE_FILE is not up to date."
echo "Please run 'make helm-example' and commit the changes."
exit 1
fi