-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (91 loc) · 2.94 KB
/
proxy-web-check.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
name: proxy-web-check
on:
pull_request:
branches: [ master ]
paths:
- 'proxy-web/**'
env:
JAVA_VERSION: "15"
JAVA_DISTRIBUTION: "zulu"
GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }}
jobs:
proxy-web-check-build:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.ref }}-proxy-web-check-build
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch
- name: Set up secrets
run: |
echo "$GCP_SA_KEY_INFRA" >> ./proxy-web/infra/credentials-gcp-infra.json
- name: Build project
run: |
set -o pipefail &&
cd proxy-web &&
./gradlew --no-daemon assemble &&
cd ..
- name: Build container images
run: |
set -o pipefail &&
docker compose -f docker/proxy-web-service-compose.yaml build
- name: Preview infrastructure
uses: pulumi/actions@v5
with:
command: preview
stack-name: prod
work-dir: proxy-web/infra
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- name: Artifacts
uses: actions/upload-artifact@v4
if: always() # Ensure all artifacts are collected, even after errors
with:
name: Build
path: |
**/build
proxy-web/infra
proxy-web-check-test:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.ref }}-proxy-web-check-test
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch
- name: Set up secrets
run: |
echo "$GCP_SA_KEY_INFRA" >> ./proxy-web/infra/credentials-gcp-infra.json
- name: Test
run: |
set -o pipefail &&
cd proxy-web &&
./gradlew --no-daemon --continue jsTest &&
cd ..
- name: Generate test report
uses: mikepenz/action-junit-report@v4
if: always() # Ensure all test reports are collected, even after errors
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
check_name: 'proxy-web-check-test-results'
- name: Artifacts
uses: actions/upload-artifact@v4
if: always() # Ensure all artifacts are collected, even after errors
with:
name: Tests
path: '**/build/test-results/**/TEST-*.xml'