Skip to content

Commit 446b269

Browse files
committed
run the test matrix also when running the release workflow and on main when something is pushed
1 parent f3c00a6 commit 446b269

3 files changed

Lines changed: 46 additions & 30 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11
name: Test
22

3-
on:
4-
pull_request:
5-
types: [ opened, reopened, synchronize ]
3+
on: push
64

75
concurrency:
86
group: ${{ github.ref }}
97
cancel-in-progress: true
108

119
jobs:
1210
test:
13-
name: Tests (PostgreSQL ${{ matrix.postgres-version }})
14-
runs-on: ubuntu-24.04
15-
timeout-minutes: 5
16-
strategy:
17-
fail-fast: false
18-
matrix:
19-
postgres-version: [ 15, 16, 17, 18 ]
20-
steps:
21-
- uses: actions/checkout@v5
22-
with:
23-
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
24-
- uses: aboutbits/github-actions-java/setup-with-gradle@v4
25-
with:
26-
java-version: 25
27-
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
28-
- name: Build & Test
29-
run: >-
30-
./gradlew
31-
--console=colored
32-
:operator:test
33-
--fail-fast
34-
-Dquarkus.test.profile=test-pg${{ matrix.postgres-version }}
35-
env:
36-
GITHUB_USER_NAME: ${{ github.actor }}
37-
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
uses: ./.github/workflows/test.yml
12+
secrets: inherit

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ env:
1818
DOCKER_IMAGE: ghcr.io/${{ github.repository }}
1919

2020
jobs:
21-
build-and-publish:
21+
test:
22+
uses: ./.github/workflows/test.yml
23+
secrets: inherit
24+
25+
build-and-release:
26+
needs: test
2227
runs-on: ubuntu-24.04
2328
timeout-minutes: 15
2429
steps:
@@ -38,7 +43,7 @@ jobs:
3843
run: echo "version=$(./gradlew currentVersion -q -Prelease.quiet)" >> $GITHUB_OUTPUT
3944
shell: bash
4045
- name: Build package
41-
run: ./gradlew --console=colored build
46+
run: ./gradlew --console=colored build -x test
4247
- name: Build Docker image
4348
uses: aboutbits/github-actions-docker/build-push@v1
4449
with:

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
6+
concurrency:
7+
group: ${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
test:
12+
name: Tests (PostgreSQL ${{ matrix.postgres-version }})
13+
runs-on: ubuntu-24.04
14+
timeout-minutes: 5
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
postgres-version: [ 15, 16, 17, 18 ]
19+
steps:
20+
- uses: actions/checkout@v6
21+
with:
22+
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
23+
- uses: aboutbits/github-actions-java/setup-with-gradle@v4
24+
with:
25+
java-version: 25
26+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
27+
- name: Build & Test
28+
run: >-
29+
./gradlew
30+
--console=colored
31+
:operator:test
32+
--fail-fast
33+
-Dquarkus.test.profile=test-pg${{ matrix.postgres-version }}
34+
env:
35+
GITHUB_USER_NAME: ${{ github.actor }}
36+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)