-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (61 loc) · 1.98 KB
/
ci-pull.yml
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Java CI with Maven on Pull
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "actions"] #Allows testing Actions changes in a fork
schedule:
- cron: "0 12 * * 1-5"
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:7.0.7
env:
POSTGRES_USER: sampleUser
POSTGRES_PASSWORD: openliberty
POSTGRES_DB: testdb
# Set health checks to wait until postgres has started
options: >-
--health-cmd "echo 'db.runCommand("ping").ok' | mongosh --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up JDK 21
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 21
distribution: 'temurin'
cache: maven
- name: Compile App and Tests
run: |
mvn -B compiler:compile
mvn -B compiler:testCompile
- name: Create Server and Deploy App
run: |
mvn -B liberty:create
mvn -B liberty:deploy
- name: Start Server
run: mvn -B liberty:start
- name: Run Integration Tests
run: mvn -B failsafe:integration-test
- name: Stop Server
run: mvn -B liberty:stop
- name: Verify Integration Test Results
run: mvn -B failsafe:verify
- name: Archive Liberty logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: liberty-logs
path: target/liberty/wlp/usr/servers/JakartaConcurrencyServer/logs/
retention-days: 1