-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (79 loc) · 2.72 KB
/
staging-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
name: staging-check
on:
pull_request:
branches: [ master ]
env:
GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }}
GCP_SA_KEY_APP: ${{ secrets.GCP_SA_KEY_APP }}
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }}
SLACK_CLIENT_SECRET: ${{ secrets.SLACK_CLIENT_SECRET }}
MONITORING_SLACK_URL: ${{ secrets.MONITORING_SLACK_URL }}
GOOGLE_ANALYTICS_MEASUREMENT_ID: ${{ secrets.GOOGLE_ANALYTICS_MEASUREMENT_ID }}
GOOGLE_ANALYTICS_API_SECRET: ${{ secrets.GOOGLE_ANALYTICS_API_SECRET }}
jobs:
detect-changed-services:
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.ref }}-detect-changed-services
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Collect all changed services
uses: ./.github/actions/detect-changed-services
id: changed-services
outputs:
changed_services: ${{ steps.changed-services.outputs.changed_services }}
build-service:
if: needs.detect-changed-services.outputs.changed_services != ''
runs-on: ubuntu-24.04
strategy:
matrix:
service: ${{ fromJSON(needs.detect-changed-services.outputs.changed_services) }}
concurrency:
group: ${{ github.ref }}-${{ matrix.service }}-build-service
cancel-in-progress: true
needs: detect-changed-services
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Gradle
uses: ./.github/actions/setup-gradle
- name: Build service
uses: ./.github/actions/build-service
with:
service: ${{ matrix.service }}
- name: Build container images
run: |
set -Eeuo pipefail
if [ -e "tools/docker/${{ matrix.service }}-compose.yaml" ]; then
docker compose -f tools/docker/${{ matrix.service }}-compose.yaml build
else
echo "Skipping step as required file doesn't exist"
fi
- name: Preview infrastructure
uses: ./.github/actions/infra
with:
command: preview
service: ${{ matrix.service }}
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 (${{ matrix.service }})
path: |
**/build
**/secrets.properties
${{ matrix.service }}/infra
unit-test:
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.ref }}-unit-test
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
uses: ./.github/actions/unit-test