Skip to content

Commit b5114fe

Browse files
committed
Test last three releases in GitHub Actions
Closes: #984
1 parent 98b059d commit b5114fe

File tree

5 files changed

+34
-9
lines changed

5 files changed

+34
-9
lines changed

.github/workflows/pr-acceptance-ce.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- 'CHANGELOG.md'
1313
- 'CONTRIBUTING.md'
1414

15-
concurrency:
15+
concurrency:
1616
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
1717
cancel-in-progress: true
1818

@@ -31,6 +31,10 @@ jobs:
3131
timeout-minutes: 60
3232
runs-on: ubuntu-latest
3333
needs: [go-version]
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
gitlab-version: ["14.9.4-ce.0", "14.10.3-ce.0", "15.0.0-ce.0"]
3438
steps:
3539
- uses: actions/setup-go@v3
3640
with:
@@ -41,5 +45,5 @@ jobs:
4145
with:
4246
path: ~/go/pkg/mod
4347
key: ${{ github.job }}-${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'GNUMakefile') }}
44-
- run: make testacc-up
48+
- run: make testacc-up GITLAB_CE_VERSION=${{ matrix.gitlab-version }}
4549
- run: make testacc

.github/workflows/pr-acceptance-ee.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626
# Disable permissions on the GITHUB_TOKEN for all scopes.
2727
permissions: {}
2828

29-
concurrency:
29+
concurrency:
3030
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
3131
cancel-in-progress: true
3232

@@ -65,6 +65,10 @@ jobs:
6565
timeout-minutes: 60
6666
runs-on: ubuntu-latest
6767
needs: [go-version, license-encryption-password]
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
gitlab-version: ["14.9.4-ee.0", "14.10.3-ee.0", "15.0.0-ee.0"]
6872
steps:
6973
- uses: actions/setup-go@v3
7074
with:
@@ -79,7 +83,7 @@ jobs:
7983
run: |
8084
openssl version
8185
openssl enc -d -aes-256-cbc -pbkdf2 -iter 20000 -in Gitlab-license.encrypted -out Gitlab-license.txt -pass "pass:${{ secrets.LICENSE_ENCRYPTION_PASSWORD }}"
82-
- run: make testacc-up SERVICE=gitlab-ee
86+
- run: make testacc-up SERVICE=gitlab-ee GITLAB_EE_VERSION=${{ matrix.gitlab-version }}
8387
# Check out the pull request code (as opposed to the target project).
8488
# This overwrites the entire directory and deleted the unencrypted GitLab license file. The
8589
# service has already started and continues using the license even though the file is deleted.
@@ -96,4 +100,3 @@ jobs:
96100
# This is made safe because we have already cleaned up the unencrypted GitLab license file,
97101
# we have no other secrets, and we are not using GitHub tokens.
98102
- run: make testacc
99-

.github/workflows/push.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ jobs:
9494
timeout-minutes: 60
9595
runs-on: ubuntu-latest
9696
needs: [go-version]
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
gitlab-version: ["14.9.4-ce.0", "14.10.3-ce.0", "15.0.0-ce.0"]
97101
steps:
98102
- uses: actions/setup-go@v3
99103
with:
@@ -104,7 +108,7 @@ jobs:
104108
with:
105109
path: ~/go/pkg/mod
106110
key: ${{ github.job }}-${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'GNUMakefile') }}
107-
- run: make testacc-up
111+
- run: make testacc-up GITLAB_CE_VERSION=${{ matrix.gitlab-version }}
108112
- run: make testacc
109113

110114
acceptance-ee:
@@ -114,6 +118,10 @@ jobs:
114118
timeout-minutes: 60
115119
runs-on: ubuntu-latest
116120
needs: [go-version, license-encryption-password]
121+
strategy:
122+
fail-fast: false
123+
matrix:
124+
gitlab-version: ["14.9.4-ee.0", "14.10.3-ee.0", "15.0.0-ee.0"]
117125
steps:
118126
- uses: actions/setup-go@v3
119127
with:
@@ -129,5 +137,5 @@ jobs:
129137
openssl version
130138
openssl enc -d -aes-256-cbc -pbkdf2 -iter 20000 -in Gitlab-license.encrypted -out Gitlab-license.txt -pass "pass:${{ secrets.LICENSE_ENCRYPTION_PASSWORD }}"
131139
# Note we specifically launch the gitlab-ee service.
132-
- run: make testacc-up SERVICE=gitlab-ee
140+
- run: make testacc-up SERVICE=gitlab-ee GITLAB_EE_VERSION=${{ matrix.gitlab-version }}
133141
- run: make testacc

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ Your workspace will automatically open the repository and branch that you select
108108

109109
The acceptance tests can run against a Gitlab instance where you have a token with administrator permissions (likely not gitlab.com).
110110

111+
The GitHub Actions test against the three latest GitLab releases.
112+
111113
#### Option 1: Run tests against a local Gitlab container with docker-compose
112114

113115
This option is the easiest and requires [docker-compose](https://docs.docker.com/compose/install/) (version 1.13+) to be installed on your machine.
@@ -162,6 +164,14 @@ $ make testacc GITLAB_TOKEN=example123 GITLAB_BASE_URL=https://example.com/api/v
162164
$ make testacc-up SERVICE=gitlab-ee
163165
```
164166

167+
* **Run tests against specific GitLab version:**
168+
169+
Specify the GitLab release in the `GITLAB_CE_VERSION` or `GITLAB_EE_VERSION`, e.g.:
170+
171+
```sh
172+
$ make testacc-up GITLAB_CE_VERSION=15.0.0-ce.0
173+
```
174+
165175
* **Run a single test:**
166176

167177
You can pass a pattern to the `RUN` variable to run a reduced number of tests. For example:

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: '3'
44
# Only one of these services should be run at a time.
55
services:
66
gitlab-ce:
7-
image: gitlab/gitlab-ce
7+
image: gitlab/gitlab-ce:${GITLAB_CE_VERSION:-latest}
88
restart: always
99
ports:
1010
- 8080:80
@@ -25,7 +25,7 @@ services:
2525
timeout: 2m
2626

2727
gitlab-ee:
28-
image: gitlab/gitlab-ee
28+
image: gitlab/gitlab-ee:${GITLAB_EE_VERSION:-latest}
2929
restart: always
3030
ports:
3131
- 8080:80

0 commit comments

Comments
 (0)