Repository navigation
84 lines (74 loc) · 2.13 KB
/
Copy pathtest-live.yml
File metadata and controls
84 lines (74 loc) · 2.13 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
name: test-live
on:
workflow_run:
workflows:
- test
types:
- completed
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sing-cloudflared-live-testbox
cancel-in-progress: false
env:
LIVE_TEST_PATTERN: '^TestLive'
jobs:
live:
name: live (${{ matrix.os }}, go${{ matrix.go-version }})
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push'
)
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: true
max-parallel: 1
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
go-version:
- '1.26'
- '1.25'
- '1.24'
defaults:
run:
shell: bash
env:
CF_LIVE_TESTS: "1"
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
CF_ZONE_NAME: ${{ secrets.CF_ZONE_NAME }}
CF_TEST_HOSTNAME: ${{ secrets.CF_TEST_HOSTNAME }}
steps:
- name: Checkout workflow_dispatch ref
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v5
- name: Checkout triggering workflow ref
if: github.event_name == 'workflow_run'
uses: actions/checkout@v5
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_sha }}
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Validate live test configuration
run: |
set -euo pipefail
for name in CF_API_TOKEN CF_ACCOUNT_ID CF_ZONE_ID CF_ZONE_NAME CF_TEST_HOSTNAME; do
if [ -z "${!name:-}" ]; then
echo "missing required Actions configuration: $name" >&2
exit 1
fi
done
- name: Run live integration tests
run: go test -v ./... -run "$LIVE_TEST_PATTERN" -count=1 -timeout 18m