-
Notifications
You must be signed in to change notification settings - Fork 104
81 lines (72 loc) · 1.77 KB
/
test_acceptance.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
name: Testing - Acceptance
# Split until path filtering for jobs added
# https://github.community/t/path-filtering-for-jobs-and-steps/16447
on:
push:
branches: [master]
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "**.bash"
- "**.bats"
pull_request:
branches: [master]
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "**.bash"
- "**.bats"
jobs:
build:
name: Build kubesec
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build kubesec
run: |
make build
- name: Upload kubesec
uses: actions/upload-artifact@v4
with:
name: kubesec
path: dist/kubesec
acceptance:
name: Bats ${{matrix.test}} tests
runs-on: ubuntu-latest
needs: build
env:
REMOTE_PORT: "8080"
strategy:
fail-fast: false
matrix:
test: ["acceptance", "remote"]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# needed for bats tests
submodules: true
- name: Download kubesec
uses: actions/download-artifact@v4
with:
name: kubesec
path: dist
- name: Set kubesec as executable again
run: |
chmod +x ./dist/kubesec
- name: Start kubesec http
if: matrix.test == 'remote'
run: |
echo "REMOTE_URL=localhost:$REMOTE_PORT" >> $GITHUB_ENV
./dist/kubesec http $REMOTE_PORT 2>error.log >output.log &
- name: Run bats acceptance tests against built binary
run: |
make test-${{ matrix.test }}-built