-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (128 loc) · 4.34 KB
/
Copy pathci.yml
File metadata and controls
137 lines (128 loc) · 4.34 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
# Cancel in-flight runs for the same branch/PR so pushes don't queue up.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# -- Format / vet / tidy ------------------------------------------------------
check:
name: Format / vet / tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0
- name: Check formatting, vet, and module tidy
run: mage dev:check
# -- Unit tests --------------------------------------------------------------─
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0
- name: Run unit tests
run: mage test:unit
- name: Coverage summary
if: always()
continue-on-error: true
run: |
if [ ! -f coverage.out ]; then exit 0; fi
{
echo "## Test coverage"
echo '```'
go tool cover -func=coverage.out
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
# -- Puppet stack integration tests ------------------------------------------
# Runs the full OpenVox 8 stack: Go CA (TLS) → OpenVox Server (WEBrick) →
# OpenVoxDB. Requires docker compose and network access to pull base images
# on first run. Same standard/FIPS matrix as the compose job.
puppet:
name: Puppet stack tests (${{ matrix.build }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- build: standard
mage_target: test:puppet
- build: fips
mage_target: test:puppetFIPS
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0
- name: Start rngd (replenish entropy pool for FIPS crypto)
if: matrix.build == 'fips'
run: sudo apt-get install -y --no-install-recommends rng-tools && sudo rngd -r /dev/urandom
- name: Run Puppet stack integration tests
env:
MAGE_TARGET: ${{ matrix.mage_target }}
run: mage "$MAGE_TARGET"
# -- Migration integration tests --------------------------------------------
# Boots a real VoxPupuli Puppet Server, creates a genuine CA, then imports
# it into puppet-ca and verifies the full migration path.
migration:
name: Migration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0
- name: Run migration integration tests
run: mage test:migration
# -- Compose integration tests (docker compose) ------------------------------─
# podman-compose is not pre-installed on GitHub runners; composeCmd() in
# magefile.go falls back to `docker compose` (v2 plugin, always available).
# Same standard/FIPS matrix as the unit test job above.
compose:
name: Compose integration tests (${{ matrix.build }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- build: standard
mage_target: test:integCompose
- build: fips
mage_target: test:integComposeFIPS
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0
- name: Start rngd (replenish entropy pool for FIPS crypto)
if: matrix.build == 'fips'
run: sudo apt-get install -y --no-install-recommends rng-tools && sudo rngd -r /dev/urandom
- name: Run compose integration tests
env:
MAGE_TARGET: ${{ matrix.mage_target }}
run: mage "$MAGE_TARGET"