-
-
Notifications
You must be signed in to change notification settings - Fork 2
163 lines (155 loc) · 4.52 KB
/
default.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Default
on:
push:
branches-ignore:
- master
- crowdin
jobs:
check-gradle-version:
name: Check Gradle version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: madhead/check-gradle-version@v1
continue-on-error: true
build-policies:
name: Build policies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- run: ./gradlew :policies:privacy
- run: tar -cvf policies.tar policies/build
- uses: actions/upload-artifact@v4
with:
name: policies
path: |
policies.tar
unit-test:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- run: ./gradlew check jacocoTestReport
- uses: actions/upload-artifact@v4
if: always()
with:
name: unit-test-results
retention-days: 1
path: |
**/build/reports
**/build/test-results
**/build/jacoco
db-test:
name: DB test
runs-on: ubuntu-latest
env:
POSTGRES_HOST: localhost
POSTGRES_USER: tyzenhaus
POSTGRES_PASSWORD: tyzenhaus
POSTGRES_PORT: 5432
POSTGRES_DB: tyzenhaus
services:
postgres:
image: postgres:14
ports:
- 5432:5432
env:
POSTGRES_USER: ${{env.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{env.POSTGRES_PASSWORD}}
POSTGRES_DB: ${{env.POSTGRES_DB}}
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- run: ./gradlew :repository:postgresql:liquibaseUpdate
env:
DATABASE_URL: postgres://${{env.POSTGRES_USER}}:${{env.POSTGRES_PASSWORD}}@${{env.POSTGRES_HOST}}:${{env.POSTGRES_PORT}}/${{env.POSTGRES_DB}}
- run: psql -h ${{env.POSTGRES_HOST}} -U ${{env.POSTGRES_USER}} -d ${{env.POSTGRES_DB}} <repository/postgresql/src/test/sql/seed.sql
- run: ./gradlew dbTest jacocoDbTestReport
env:
DATABASE_URL: postgres://${{env.POSTGRES_USER}}:${{env.POSTGRES_PASSWORD}}@${{env.POSTGRES_HOST}}:${{env.POSTGRES_PORT}}/${{env.POSTGRES_DB}}
- uses: actions/upload-artifact@v4
if: always()
with:
name: db-test-results
retention-days: 1
path: |
**/build/reports
**/build/test-results
**/build/jacoco
mini-app-test:
name: Mini App test
runs-on: ubuntu-latest
needs:
- build-policies
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'mini-app/.nvmrc'
- run: yarn install
working-directory: mini-app
- uses: actions/download-artifact@v4
with:
name: policies
- run: |
tar xvf policies.tar
- run: yarn run build
working-directory: mini-app
test-publish:
name: Publish test results
runs-on: ubuntu-latest
needs:
- unit-test
- db-test
- mini-app-test
if: always()
steps:
- uses: actions/download-artifact@v4
with:
name: unit-test-results
- uses: actions/download-artifact@v4
with:
name: db-test-results
- uses: mikepenz/action-junit-report@v4
with:
report_paths: '**/test-results/**/TEST-*.xml'
codecov:
name: CodeCov
runs-on: ubuntu-latest
needs:
- unit-test
- db-test
- mini-app-test
if: always()
steps:
- uses: actions/download-artifact@v4
with:
name: unit-test-results
- uses: actions/download-artifact@v4
with:
name: db-test-results
- run: bash <(curl -s https://codecov.io/bash)