-
Notifications
You must be signed in to change notification settings - Fork 7
111 lines (98 loc) · 3.54 KB
/
pr-integration.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
# Action for running client integration tests against PRs. This test uses local
# server changes but runs a published version of the client, so it will not pick
# up local client changes.
name: PR Integration Tests
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- '.github/**'
- 'service/local-dev/**'
pull_request:
branches:
- main
# There is an issue with GitHub required checks and paths-ignore. We don't really need to
# run the tests if there are only irrelevant changes (see paths-ignore above). However,
# we require tests to pass by making a "required check" rule on the branch. If the action
# is not triggered, the required check never passes and you are stuck. Therefore, we have
# to run tests even when we only change a markdown file. So don't do what I did and put a
# paths-ignore right here!
workflow_dispatch: {}
jobs:
pr-integration-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.1
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Initialize Postgres DB for local server test run
env:
PGPASSWORD: postgres
run: psql -h 127.0.0.1 -U postgres -f ./service/local-dev/local-postgres-init.sql
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Write config
id: config
uses: ./.github/actions/write-credentials
with:
user-delegated-sa-b64: ${{ secrets.USER_DELEGATED_SA_DEV }}
buffer-client-sa-b64: ${{ secrets.BUFFER_CLIENT_SA_DEV }}
testrunner-sa-b64: ${{ secrets.TESTRUNNER_SA_DEV }}
testrunner-k8s-sa-b64: ${{ secrets.TESTRUNNER_K8S_SA_DEV }}
wsm-sa-b64: ${{ secrets.WSM_SA_DEV }}
janitor-sa-b64: ${{ secrets.JANITOR_SA_DEV }}
policy-client-sa-b64: ${{ secrets.POLICY_CLIENT_SA_DEV }}
- name: Launch local server
uses: ./.github/actions/start-local-server
- name: Run the integration test suite
id: integration-test
uses: ./.github/actions/integration-test
with:
test-server: workspace-local.json
test: suites/PRIntegration.json
- name: Skip version bump merges
id: bump-check
uses: ./.github/actions/bump-skip
with:
event-name: ${{ github.event_name }}
- name: "Notify WSM Slack"
# post to WSM Slack when a regular push (i.e. non-bumper push) is made to main branch
if: failure() && github.event_name == 'push' && steps.bump-check.outputs.is-bump == 'no'
uses: broadinstitute/[email protected]
# see https://github.com/broadinstitute/action-slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
with:
status: ${{ job.status }}
channel: "#dsp-workspaces-test-alerts"
username: "WSM push to main branch"
author_name: "integrationTest"
icon_emoji: ":triangular_ruler:"
fields: job, commit
- name: Archive WSM and TestRunner logs
id: archive_logs
if: always()
uses: actions/upload-artifact@v3
with:
name: wsm-and-testrunner-logs
path: |
wsm.log
${{ steps.integration-test.outputs.results-dir }}