-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (77 loc) · 2.59 KB
/
Copy pathintegration-test.yml
File metadata and controls
86 lines (77 loc) · 2.59 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
81
82
83
84
85
86
name: Integration Test
run-name: "Integration Test (${{ inputs.fmsgd_ref }})"
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
fmsgd_ref:
description: 'fmsgd branch/ref to test'
required: false
default: 'main'
fmsgid_ref:
description: 'fmsgid branch/ref to test'
required: false
default: 'main'
fmsg_webapi_ref:
description: 'fmsg-webapi branch/ref to test'
required: false
default: 'main'
fmsg_cli_ref:
description: 'fmsg-cli branch/ref to test'
required: false
default: 'main'
permissions:
contents: read
jobs:
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.27.x"
- name: Select component refs
id: refs
env:
GH_TOKEN: ${{ github.token }}
PR_BRANCH: ${{ github.head_ref }}
INPUT_FMSGD: ${{ inputs.fmsgd_ref }}
INPUT_FMSGID: ${{ inputs.fmsgid_ref }}
INPUT_WEBAPI: ${{ inputs.fmsg_webapi_ref }}
INPUT_CLI: ${{ inputs.fmsg_cli_ref }}
run: |
pick_ref() {
local repo="$1" explicit="$2"
if [ -n "$explicit" ]; then
printf '%s\n' "$explicit"
elif [ -n "$PR_BRANCH" ] && gh api "repos/markmnl/$repo/git/ref/heads/$PR_BRANCH" >/dev/null 2>&1; then
printf '%s\n' "$PR_BRANCH"
else
echo main
fi
}
echo "fmsgd=$(pick_ref fmsgd "$INPUT_FMSGD")" >> "$GITHUB_OUTPUT"
echo "fmsgid=$(pick_ref fmsgid "$INPUT_FMSGID")" >> "$GITHUB_OUTPUT"
echo "webapi=$(pick_ref fmsg-webapi "$INPUT_WEBAPI")" >> "$GITHUB_OUTPUT"
echo "cli=$(pick_ref fmsg-cli "$INPUT_CLI")" >> "$GITHUB_OUTPUT"
- name: Run integration tests
run: bash test/run-tests.sh
env:
FMSGD_REF: ${{ steps.refs.outputs.fmsgd }}
FMSGID_REF: ${{ steps.refs.outputs.fmsgid }}
FMSG_WEBAPI_REF: ${{ steps.refs.outputs.webapi }}
FMSG_CLI_REF: ${{ steps.refs.outputs.cli }}
FMSG_CHALLENGE_MODE: ALWAYS
- name: Upload integration logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-test-logs
path: test/.logs/
if-no-files-found: ignore
- name: Cleanup
if: always()
run: bash test/run-tests.sh cleanup