-
Notifications
You must be signed in to change notification settings - Fork 18
107 lines (90 loc) · 2.81 KB
/
test_demo_apps.yml
File metadata and controls
107 lines (90 loc) · 2.81 KB
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
name: Test Demo Apps
on:
workflow_call:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout java-transact
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Remove local DBOS Maven artifacts
run: rm -rf ~/.m2/repository/dev/dbos
- name: Publish to Maven Local
run: ./gradlew publishToMavenLocal
- name: Get version
id: version
run: echo "version=$(./gradlew properties -q | grep '^version:' | awk '{print $2}')" >> $GITHUB_OUTPUT
- name: Upload Maven Local artifacts
uses: actions/upload-artifact@v7
with:
name: dbos-maven-local
path: ~/.m2/repository/dev/dbos
test-demo-apps:
needs: publish
runs-on: ubuntu-latest
env:
PGPASSWORD: dbos
PGUSER: postgres
strategy:
fail-fast: false
matrix:
include:
- app: java/dbos-starter
build_file: app/build.gradle.kts
- app: java/dbos-toolbox
build_file: app/build.gradle.kts
- app: java/widget-store
build_file: build.gradle.kts
- app: kotlin/dbos-starter
build_file: app/build.gradle.kts
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: dbos
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Checkout dbos-demo-apps
uses: actions/checkout@v6
with:
repository: dbos-inc/dbos-demo-apps
path: dbos-demo-apps
- name: Download Maven Local artifacts
uses: actions/download-artifact@v7
with:
name: dbos-maven-local
path: ~/.m2/repository/dev/dbos
- name: Patch ${{ matrix.app }}
working-directory: dbos-demo-apps/${{ matrix.app }}
run: |
VERSION="${{ needs.publish.outputs.version }}"
sed -i "s|dev\.dbos:\([^:]*\):[^\"']*|dev.dbos:\1:${VERSION}|g" "${{ matrix.build_file }}"
sed -i 's/repositories {/repositories { mavenLocal();/' "${{ matrix.build_file }}"
- name: Build and test ${{ matrix.app }}
working-directory: dbos-demo-apps/${{ matrix.app }}
run: ./gradlew build