2323 GOPROXY : " direct"
2424
2525jobs :
26- build :
27- runs-on : ubuntu-22.04
28- steps :
29- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30- - name : Configure Go Proxy
31- uses : ./.github/actions/configure-goproxy
32- with :
33- user : ${{ secrets.ARTIFACTORY_USER }}
34- token : ${{ secrets.ARTIFACTORY_TOKEN }}
35- url : ${{ secrets.ARTIFACTORY_URL_DEV }}
36- - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
37- with :
38- go-version-file : ' go.mod'
39- - name : Build
40- run : make build
41- - uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
42- with :
43- path : |
44- ~/.cache/go-build
45- ~/go/pkg/mod
46- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
47- restore-keys : |
48- ${{ runner.os }}-go-
26+ build-unsigned-snapshot :
27+ name : Build Unsigned Snapshot
28+ runs-on : ubuntu-22.04
29+ steps :
30+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31+ with :
32+ fetch-tags : ' true'
33+ - name : Configure Go Proxy
34+ uses : ./.github/actions/configure-goproxy
35+ with :
36+ user : ${{ secrets.ARTIFACTORY_USER }}
37+ token : ${{ secrets.ARTIFACTORY_TOKEN }}
38+ url : ${{ secrets.ARTIFACTORY_URL_DEV }}
39+ - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
40+ with :
41+ go-version-file : ' go.mod'
42+ - name : Setup Build Environment
43+ run : go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
44+ - name : Build Packages
45+ run : |
46+ make clean local-deb-package local-rpm-package local-apk-package
47+ - name : Upload Artifacts
48+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
49+ with :
50+ name : nginx-agent-unsigned-snapshots
51+ path : build
52+ retention-days : 1
53+ - uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
54+ with :
55+ path : |
56+ ~/.cache/go-build
57+ ~/go/pkg/mod
58+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
59+ restore-keys : |
60+ ${{ runner.os }}-go-
4961
5062 lint :
5163 name : Lint
5264 runs-on : ubuntu-22.04
53- needs : build
65+ needs : build-unsigned-snapshot
5466 steps :
5567 - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5668 - name : Configure Go Proxy
@@ -74,73 +86,53 @@ jobs:
7486 version : v2.4.0
7587
7688 unit-test :
77- name : Unit Tests
78- runs-on : ubuntu-22.04
79- permissions :
80- contents : write
81- steps :
82- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
83- - name : Configure Go Proxy
84- uses : ./.github/actions/configure-goproxy
85- with :
86- user : ${{ secrets.ARTIFACTORY_USER }}
87- token : ${{ secrets.ARTIFACTORY_TOKEN }}
88- url : ${{ secrets.ARTIFACTORY_URL_DEV }}
89- - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
90- with :
91- go-version-file : ' go.mod'
92- - name : Run Unit Tests
93- run : make unit-test
94- - name : Uplaod Test Coverage
95- uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
96- with :
97- files : ./build/test/coverage.out
98- token : ${{ secrets.CODECOV_TOKEN }}
89+ name : Unit Tests
90+ runs-on : ubuntu-22.04
91+ needs : build-unsigned-snapshot
92+ permissions :
93+ contents : write
94+ steps :
95+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
96+ - name : Configure Go Proxy
97+ uses : ./.github/actions/configure-goproxy
98+ with :
99+ user : ${{ secrets.ARTIFACTORY_USER }}
100+ token : ${{ secrets.ARTIFACTORY_TOKEN }}
101+ url : ${{ secrets.ARTIFACTORY_URL_DEV }}
102+ - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
103+ with :
104+ go-version-file : ' go.mod'
105+ - uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
106+ with :
107+ path : |
108+ ~/.cache/go-build
109+ ~/go/pkg/mod
110+ key : ${{ runner.os }}-go-
111+ - name : Run Unit Tests
112+ run : make unit-test
113+ - name : Uplaod Test Coverage
114+ uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
115+ with :
116+ files : ./build/test/coverage.out
117+ token : ${{ secrets.CODECOV_TOKEN }}
99118
100119 race-condition-test :
101- name : Unit tests with race condition detection
102- runs-on : ubuntu-22.04
103- steps :
104- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
105- - name : Configure Go Proxy
106- uses : ./.github/actions/configure-goproxy
107- with :
108- user : ${{ secrets.ARTIFACTORY_USER }}
109- token : ${{ secrets.ARTIFACTORY_TOKEN }}
110- url : ${{ secrets.ARTIFACTORY_URL_DEV }}
111- - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
112- with :
113- go-version-file : ' go.mod'
114- - name : Run unit tests with race condition detection
115- run : make race-condition-test
116-
117- build-unsigned-snapshot :
118- name : Build Unsigned Snapshot
119- runs-on : ubuntu-22.04
120- steps :
121- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
122- with :
123- fetch-tags : ' true'
124- - name : Configure Go Proxy
125- uses : ./.github/actions/configure-goproxy
126- with :
127- user : ${{ secrets.ARTIFACTORY_USER }}
128- token : ${{ secrets.ARTIFACTORY_TOKEN }}
129- url : ${{ secrets.ARTIFACTORY_URL_DEV }}
130- - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
131- with :
132- go-version-file : ' go.mod'
133- - name : Setup Build Environment
134- run : go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
135- - name : Build Packages
136- run : |
137- make clean local-deb-package local-rpm-package local-apk-package
138- - name : Upload Artifacts
139- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
140- with :
141- name : nginx-agent-unsigned-snapshots
142- path : build
143- retention-days : 1
120+ name : Unit tests with race condition detection
121+ runs-on : ubuntu-22.04
122+ needs : build-unsigned-snapshot
123+ steps :
124+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
125+ - name : Configure Go Proxy
126+ uses : ./.github/actions/configure-goproxy
127+ with :
128+ user : ${{ secrets.ARTIFACTORY_USER }}
129+ token : ${{ secrets.ARTIFACTORY_TOKEN }}
130+ url : ${{ secrets.ARTIFACTORY_URL_DEV }}
131+ - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
132+ with :
133+ go-version-file : ' go.mod'
134+ - name : Run unit tests with race condition detection
135+ run : make race-condition-test
144136
145137 integration-tests :
146138 name : Integration Tests
@@ -505,6 +497,7 @@ jobs:
505497 performance-tests :
506498 name : Performance Tests
507499 runs-on : ubuntu-22.04
500+ needs : build-unsigned-snapshot
508501 permissions :
509502 contents : write
510503 steps :
@@ -536,14 +529,14 @@ jobs:
536529 - name : Push benchmark result
537530 if : ${{ success() && github.ref_name == 'main'}}
538531 run : git push 'https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/nginx/agent.git' benchmark-results:benchmark-results
532+
539533 load-tests :
540534 name : Load Tests
541535 if : ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
542536 permissions :
543537 contents : write
544538 runs-on : ubuntu-22.04
545539 needs : build-unsigned-snapshot
546-
547540 steps :
548541 - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
549542 - uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
0 commit comments