Skip to content

Commit 4065364

Browse files
committed
Add release-gate workflow for self-hosted runner testing
- Triggers only via workflow_dispatch (API) - Runs all tests on self-hosted runner only - Removed FastCI optimization and caching - Uses third-party-actions for NuGet and pnpm
1 parent fe96074 commit 4065364

File tree

1 file changed

+216
-0
lines changed

1 file changed

+216
-0
lines changed

.github/workflows/release-gate.yml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: "Release Gate Tests"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: ${{ github.sha }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
Pretest:
12+
runs-on: ${{ secrets.RELEASE_GATE_RUNNER }}
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Install Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: 1.23.x
21+
cache: false
22+
23+
# Generate mocks
24+
- name: Generate mocks
25+
run: go generate ./...
26+
27+
- name: Lint
28+
run: go vet -v ./...
29+
30+
tests:
31+
needs: Pretest
32+
name: ${{ matrix.suite.name }} Tests
33+
runs-on: ${{ secrets.RELEASE_GATE_RUNNER }}
34+
env:
35+
JFROG_CLI_LOG_LEVEL: "DEBUG"
36+
GRADLE_OPTS: -Dorg.gradle.daemon=false
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
suite:
41+
- name: 'Unit'
42+
43+
- name: 'Scan Repository'
44+
package: 'scanrepository'
45+
46+
- name: 'Scan Pull Request'
47+
package: 'scanpullrequest'
48+
49+
- name: 'Package Handlers'
50+
package: 'packagehandlers'
51+
52+
steps:
53+
# Configure prerequisites
54+
- uses: actions/checkout@v4
55+
56+
- name: Setup Go
57+
uses: actions/setup-go@v5
58+
with:
59+
go-version: 1.23.x
60+
cache: false
61+
62+
- name: Install npm
63+
uses: actions/setup-node@v3
64+
with:
65+
node-version: "16"
66+
67+
- name: Setup Python3
68+
uses: actions/setup-python@v4
69+
with:
70+
python-version: "3.x"
71+
72+
- name: Install python components
73+
run: python -m pip install pipenv poetry
74+
75+
- name: Install dotnet
76+
uses: actions/setup-dotnet@v4
77+
with:
78+
dotnet-version: "6.x"
79+
80+
- name: Install Mono on linux
81+
run: |
82+
sudo apt-get update
83+
sudo apt-get install -y mono-devel
84+
85+
- name: Install NuGet
86+
uses: third-party-actions/[email protected]
87+
with:
88+
nuget-version: 6.11.0
89+
90+
- uses: awalsh128/cache-apt-pkgs-action@latest
91+
with:
92+
packages: apt-transport-https dirmngr gnupg ca-certificates
93+
version: 1.0
94+
95+
- name: Install Pnpm
96+
uses: third-party-actions/[email protected]
97+
with:
98+
version: 8
99+
100+
- name: Install Java
101+
uses: actions/setup-java@v4
102+
with:
103+
distribution: "adopt"
104+
java-version: "11"
105+
106+
- name: Install Conan
107+
run: |
108+
python -m pip install conan
109+
conan profile detect
110+
111+
# Generate mocks
112+
- name: Generate mocks
113+
run: go generate ./...
114+
115+
- name: Run Tests
116+
run: go test github.com/jfrog/frogbot/v2/${{ matrix.suite.package }} -v -race -timeout 50m -cover
117+
env:
118+
JF_URL: ${{ secrets.PLATFORM_URL }}
119+
JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
120+
121+
github-integration:
122+
name: GitHub Integration Tests
123+
needs: Pretest
124+
runs-on: ${{ secrets.RELEASE_GATE_RUNNER }}
125+
env:
126+
JFROG_CLI_LOG_LEVEL: "DEBUG"
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- name: Setup Go
131+
uses: actions/setup-go@v5
132+
with:
133+
go-version: 1.23.x
134+
cache: false
135+
136+
- name: Run Tests
137+
run: go test github_test.go integrationutils.go commands.go -v -race -timeout 30m -cover
138+
env:
139+
JF_URL: ${{ secrets.PLATFORM_URL }}
140+
JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
141+
FROGBOT_TESTS_GITHUB_TOKEN: ${{ secrets.FROGBOT_TESTS_GITHUB_TOKEN }}
142+
143+
azure-integration:
144+
name: Azure Integration Tests
145+
needs: Pretest
146+
runs-on: ${{ secrets.RELEASE_GATE_RUNNER }}
147+
env:
148+
JFROG_CLI_LOG_LEVEL: "DEBUG"
149+
steps:
150+
- uses: actions/checkout@v4
151+
152+
- name: Setup Go
153+
uses: actions/setup-go@v5
154+
with:
155+
go-version: 1.23.x
156+
cache: false
157+
158+
- name: Run Tests
159+
run: go test azure_test.go integrationutils.go commands.go -v -race -timeout 30m -cover
160+
env:
161+
JF_URL: ${{ secrets.PLATFORM_URL }}
162+
JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
163+
FROGBOT_TESTS_AZURE_TOKEN: ${{ secrets.FROGBOT_TESTS_AZURE_TOKEN }}
164+
165+
gitlab-integration:
166+
name: GitLab Integration Tests
167+
needs: Pretest
168+
runs-on: ${{ secrets.RELEASE_GATE_RUNNER }}
169+
env:
170+
JFROG_CLI_LOG_LEVEL: "DEBUG"
171+
steps:
172+
- uses: actions/checkout@v4
173+
174+
- name: Setup Go
175+
uses: actions/setup-go@v5
176+
with:
177+
go-version: 1.23.x
178+
cache: false
179+
180+
- name: Run Tests
181+
run: go test gitlab_test.go integrationutils.go commands.go -v -race -timeout 30m -cover
182+
env:
183+
JF_URL: ${{ secrets.PLATFORM_URL }}
184+
JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
185+
FROGBOT_TESTS_GITLAB_TOKEN: ${{ secrets.FROGBOT_TESTS_GITLAB_TOKEN }}
186+
187+
bitbucket-server-integration:
188+
name: Bitbucket Server Integration Tests
189+
needs: Pretest
190+
runs-on: ${{ secrets.RELEASE_GATE_RUNNER }}
191+
steps:
192+
- uses: actions/checkout@v4
193+
194+
- name: Setup Go
195+
uses: actions/setup-go@v5
196+
with:
197+
go-version: 1.23.x
198+
cache: false
199+
200+
- name: Unzip Preconfigured Bitbucket Home
201+
run: unzip ${{ github.workspace }}/testdata/resources/bitbucket_server_home.zip -d ${PWD}
202+
203+
- name: Download Bitbucket Server and Run
204+
run: |
205+
bb_script_path="${{ github.workspace }}/testdata/resources/bitbucket_server_run.sh"
206+
chmod +x $bb_script_path
207+
sh $bb_script_path
208+
209+
- name: Run Tests
210+
env:
211+
JF_URL: ${{ secrets.PLATFORM_URL }}
212+
JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
213+
FROGBOT_TESTS_BB_SERVER_TOKEN: ${{ secrets.FROGBOT_TESTS_BB_SERVER_TOKEN }}
214+
JFROG_CLI_LOG_LEVEL: "DEBUG"
215+
run: go test -v bitbucket_server_test.go commands.go integrationutils.go
216+

0 commit comments

Comments
 (0)