-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (77 loc) · 2.4 KB
/
cicd.yaml
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: "CICD"
on:
push:
branches:
- '**'
workflow_call:
workflow_dispatch:
jobs:
setup:
runs-on: self-hosted
environment: 'dev'
steps:
- uses: actions/checkout@v3
name: "Checkout code"
build:
runs-on: self-hosted
environment: 'dev'
needs: setup
outputs:
build-id: ${{ steps.build.outputs.build-id }}
steps:
- uses: ./.github/actions/build-container
name: "Build container image"
id: build
run:
runs-on: self-hosted
environment: 'dev'
needs: build
outputs:
run-all-opts-port: ${{ steps.run-all-opts.outputs.port }}
run-all-opts-name: ${{ steps.run-all-opts.outputs.name }}
run-no-opts-port: ${{ steps.run-no-opts.outputs.port }}
run-no-opts-name: ${{ steps.run-no-opts.outputs.name }}
steps:
- uses: ./.github/actions/run-container-all-opts
name: "Start container with all options set"
id: run-all-opts
with:
build-id: ${{ needs.build.outputs.build-id }}
- uses: ./.github/actions/run-container-no-opts
name: "Start container with no options set"
id: run-no-opts
with:
build-id: ${{ needs.build.outputs.build-id }}
- uses: ./.github/actions/wait
name: "Wait for the containers to start"
test:
runs-on: self-hosted
environment: 'dev'
needs: [build, run]
steps:
- uses: ./.github/actions/tests/monit
name: "Test Monit with all options on"
with:
name: ${{ needs.run.outputs.run-all-opts-name }}
- uses: ./.github/actions/tests/monit
name: "Test Monit with no options on"
with:
name: ${{ needs.run.outputs.run-no-opts-name }}
- uses: ./.github/actions/tests/nginx
name: "Test Nginx with all options on"
with:
port: ${{ needs.run.outputs.run-all-opts-port }}
- uses: ./.github/actions/tests/nginx
name: "Test Nginx with no options on"
with:
port: ${{ needs.run.outputs.run-no-opts-port }}
cleanup:
runs-on: self-hosted
environment: 'dev'
needs: [build, run, test]
if: always()
steps:
- uses: ./.github/actions/cleanup
with:
images: homekit-monitord:${{ needs.build.outputs.build-id }}
containers: homekit-monitord-${{ needs.run.outputs.run-all-opts-name }} homekit-monitord-${{ needs.run.outputs.run-no-opts-name }}