-
Notifications
You must be signed in to change notification settings - Fork 11
80 lines (78 loc) · 2.63 KB
/
acceptance-tests.yml
File metadata and controls
80 lines (78 loc) · 2.63 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
# Reusable workflow to run the acceptance tests, referenced by workflow-*.yml pipelines.
name: Acceptance tests in Sandbox environment
on:
workflow_call:
inputs:
checkout_ref:
description: 'The reference to checkout before running the acceptance tests. Used to run the tests on a fork.'
required: true
type: string
notify_slack_on_failure:
description: 'Whether to notify slack or not.'
required: false
default: false
type: boolean
secrets:
tl_client_id:
required: true
tl_client_secret:
required: true
tl_signing_key_id:
required: true
tl_signing_private_key:
required: true
slack_webhook_url:
required: false
jobs:
acceptance-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout_ref }}
- name: Setup JDK
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v5
- name: Acceptance tests in sandbox
env:
TL_CLIENT_ID: ${{ secrets.tl_client_id }}
TL_CLIENT_SECRET: ${{ secrets.tl_client_secret }}
TL_SIGNING_KEY_ID: ${{ secrets.tl_signing_key_id }}
TL_SIGNING_PRIVATE_KEY: ${{ secrets.tl_signing_private_key }}
run: ./gradlew acceptance-tests
- uses: actions/upload-artifact@v4
name: Upload test results as artifact
if: always()
with:
name: test-results
path: ./build/test-results
retention-days: 1
notify-slack:
needs: acceptance-tests
runs-on: ubuntu-latest
if: ${{ always() && contains(needs.*.result, 'failure') && inputs.notify_slack_on_failure == true }}
steps:
- uses: actions/download-artifact@v4
name: Download test results artifacts
with:
name: test-results
path: ./build/test-results
- uses: dili91/testvox@v0.2.1
name: Generate Slack report from Junit results
id: generate_slack_report
with:
title: ":fire: Acceptance tests are failing in Sandbox on the Java backend library!"
include_skipped: true
reports_pattern: './build/test-results/**/*.xml'
- name: Send Slack report
uses: slackapi/slack-github-action@v1.26.0
with:
payload: ${{steps.generate_slack_report.outputs.report}}
env:
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_url }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK