-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (60 loc) · 1.67 KB
/
test.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
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test-build-args:
name: Test Build Args
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build the container and run it
id: run
uses: ./
with:
repository: ${{ github.repository }}
ref: ${{ github.sha }}
dockerfile: tests/Dockerfile.test-build-args
build-args: |
ARG_1:hello
ARG_2:foo
ARG_3:world
- name: check the output
env:
OUTPUTS: ${{steps.run.outputs.outputs }}
ARG_1: ${{ fromJSON(steps.run.outputs.outputs).arg-1 }}
ARG_2: ${{ fromJSON(steps.run.outputs.outputs).arg-2 }}
ARG_3: ${{ fromJSON(steps.run.outputs.outputs).arg-3 }}
run: |
echo ${OUTPUTS}
if [[ "$ARG_1" != "hello" ]]; then
echo "ARG_1 is not hello"
exit 1
fi
if [[ "$ARG_2" != "foo" ]]; then
echo "ARG_2 is not foo"
exit 1
fi
if [[ "$ARG_3" != "world" ]]; then
echo "ARG_3 is not world"
exit 1
fi
echo "all good"
test-failure:
name: Test Allow Exit Codes
runs-on: ubuntu-latest
strategy:
matrix:
allow-exit-codes: ["0,42,1", "0,5,6,1,42", "0,*", "42", "*"]
steps:
- uses: actions/checkout@v4
- name: build the container and run it
id: run
uses: ./
with:
repository: ${{ github.repository }}
ref: ${{ github.sha }}
dockerfile: tests/Dockerfile.test-failure
allow-exit-codes: ${{ matrix.allow-exit-codes }}