-
Notifications
You must be signed in to change notification settings - Fork 79
112 lines (98 loc) · 2.95 KB
/
pull-request.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Triggers the workflow on pull request events to the main branch
name: Pull Request on Main Branch
on:
pull_request:
branches:
- main
- "release/**"
paths:
- ".github/workflows/pull-request.yaml"
- ".github/workflows/build-and-push.yaml"
- "pom.xml"
- "Makefile"
- "config"
- "src/**"
- "acceptance_tests/**"
- "ci/**"
# cancel in-progress jobs or runs for this workflow for the same pr or branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build and Test Pull Request
if: github.repository == 'geoserver/geoserver-cloud'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Validate source code formatting
run: |
make lint
- name: Test
run: |
# `make test` runs mvn verify, which includes mvn package, so no need to run `package` separatedly for the upload step below
make test
- name: Upload application jar files
uses: actions/upload-artifact@v4
with:
name: application-jars
path: |
./**/target/*-bin.jar
./**/target/config/
retention-days: 1
compression-level: 0 # no compression
acceptance:
name: Acceptance Tests
if: github.repository == 'geoserver/geoserver-cloud'
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
strategy:
fail-fast: false
matrix:
catalog: [ 'datadir' ]
#catalog: [ 'datadir', 'pgconfig', 'jdbcconfig' ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download application jar files
uses: actions/download-artifact@v4
with:
name: application-jars
path: .
- name: Build images
# REPACKAGE=false avoids to re-package the apps during build-image
run: REPACKAGE=false make build-image
- name: Build acceptance tests docker image
run: |
make build-acceptance
- name: Install CI dependencies
id: installci
run: python3 -m pip install --user --requirement=ci/requirements.txt
- name: Launch ${{ matrix.catalog }} acceptance tests docker composition
id: start
run: |
make start-acceptance-tests-${{ matrix.catalog }}
- name: Run ${{ matrix.catalog }} acceptance tests
id: acceptance
run: |
make run-acceptance-tests-${{ matrix.catalog }}
- name: Print docker compose logs
if: always()
run: (cd compose && c2cciutils-docker-logs)
- name: Cleanup acceptance tests
if: always()
run: |
make clean-acceptance-tests-${{ matrix.catalog }}