-
Notifications
You must be signed in to change notification settings - Fork 6
164 lines (153 loc) · 4.37 KB
/
ci.yml
File metadata and controls
164 lines (153 loc) · 4.37 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: CI
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
jobs:
test-action:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
- ubuntu-latest
- codspeedhq-arm64-ubuntu-22.04
- codspeedhq-arm64-ubuntu-24.04
mode:
- simulation
- instrumentation
- walltime
- simulation,memory
runs-on: ${{ matrix.os }}
env:
CODSPEED_SKIP_UPLOAD: true
steps:
- uses: actions/checkout@v4
- name: Check basic action execution
uses: ./
with:
allow-empty: true
mode: ${{ matrix.mode }}
run: echo "Working!"
- name: Check action execution with env variables
uses: ./
env:
MY_ENV_VAR: "Hello"
with:
allow-empty: true
mode: ${{ matrix.mode }}
run: |
output=$(echo "$MY_ENV_VAR")
if [ "$output" != "Hello" ]; then
echo "Assertion failed: Expected 'Hello' but got '$output'"
exit 1
else
echo "Environment variable check passed with $output."
fi
- name: Check action in a custom directory
uses: ./
with:
allow-empty: true
mode: ${{ matrix.mode }}
working-directory: examples
# Check that the directory is actually changed
run: if [ $(basename $(pwd)) != "examples" ]; then exit 1; fi
- name: Check action with multiline command
uses: ./
with:
allow-empty: true
mode: ${{ matrix.mode }}
run: |
echo "Working";
echo "with";
echo "multiple lines";
test-runner-version-formats:
strategy:
fail-fast: false
matrix:
version:
- "latest"
- "4.4.1"
- "v4.4.1"
runs-on: ubuntu-latest
env:
CODSPEED_SKIP_UPLOAD: true
steps:
- uses: actions/checkout@v4
- name: Check action with version format ${{ matrix.version }}
uses: ./
with:
allow-empty: true
runner-version: ${{ matrix.version }}
mode: simulation
run: echo "Testing version format ${{ matrix.version }}!"
test-go-runner-version-formats:
strategy:
fail-fast: false
matrix:
version:
- "1.0.0"
- "1.0.0-beta.1"
runs-on: ubuntu-latest
env:
CODSPEED_SKIP_UPLOAD: true
steps:
- uses: actions/checkout@v4
- name: Check action with version format ${{ matrix.version }}
uses: ./
with:
allow-empty: true
go-runner-version: ${{ matrix.version }}
mode: walltime
run: echo "Testing version format ${{ matrix.version }}!"
get-recent-pinned-runner-versions:
runs-on: ubuntu-slim
outputs:
versions: ${{ steps.get-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- id: get-versions
run: echo "versions=$(jq -c 'keys_unsorted | .[-5:]' .codspeed-runner-installer-hashes.json)" >> "$GITHUB_OUTPUT"
test-recent-pinned-runner-versions:
needs: get-recent-pinned-runner-versions
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.get-recent-pinned-runner-versions.outputs.versions) }}
runs-on: ubuntu-latest
env:
CODSPEED_SKIP_UPLOAD: true
steps:
- uses: actions/checkout@v4
- name: Check action with pinned runner version ${{ matrix.version }}
uses: ./
with:
allow-empty: true
runner-version: ${{ matrix.version }}
mode: walltime # simulation not yet supported for all versions (was instrumentation before)
run: echo "Testing pinned version ${{ matrix.version }}!"
check-installer-hashes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify pinned installer hashes
run: ./scripts/check-hashes.sh
test-config-file:
runs-on: ubuntu-latest
env:
CODSPEED_SKIP_UPLOAD: true
steps:
- uses: actions/checkout@v4
- run: cat .github/test-codspeed.yml
- name: Check action with config file (no run input)
uses: ./
with:
mode: memory
config: .github/test-codspeed.yml