-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (54 loc) · 1.81 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
65
66
67
68
69
70
71
72
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
example:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write # Required by hetznercloud/tps-action
defaults:
run:
working-directory: example
steps:
- uses: actions/checkout@v4
- uses: opentofu/setup-opentofu@v1
with:
tofu_version: v1.8.6 # renovate: datasource=github-releases depName=opentofu/opentofu
tofu_wrapper: false
- uses: yokawasa/[email protected]
with:
setup-tools: |
kubectl
skaffold
kubectl: v1.31.3 # renovate: datasource=github-releases depName=kubernetes/kubernetes
skaffold: v2.13.2 # renovate: datasource=github-releases depName=GoogleContainerTools/skaffold
- name: Setup k3sup
run: curl -sLS https://get.k3sup.dev | sh
- uses: actions/setup-go@v5
with:
go-version-file: test-app/go.mod
- uses: hetznercloud/tps-action@main
- name: Swap module source
run: sed -i -e 's|source = ".*"|source = "./.."|' main.tf
- name: Setup environment
run: make up
- name: Verify environment
run: |
source files/env.sh
kubectl wait --for=condition=Ready --all node
kubectl wait --for=condition=Available --all --all-namespaces deployment
kubectl wait --for=condition=Ready --all --all-namespaces pod
- name: Deploy test app
working-directory: test-app
run: |
source ../example/files/env.sh
skaffold run
kubectl wait --for=condition=Ready --all pod -l app=test-app
- name: Cleanup
if: always()
run: make down