-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (82 loc) · 2.48 KB
/
ci.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Setup build environment
run: make ci-deps
- name: Unit Test
run: make test-all CGO_ENABLED=1 GOTEST_FLAGS=-race
build:
name: Build artifacts
runs-on: ubuntu-latest
strategy:
matrix:
include:
- {GOOS: linux, GOARCH: amd64}
- {GOOS: linux, GOARCH: arm, GOARM: 6}
- {GOOS: linux, GOARCH: arm64}
- {GOOS: darwin, GOARCH: amd64}
- {GOOS: darwin, GOARCH: arm64}
- {GOOS: windows, GOARCH: amd64}
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
GOARM: ${{ matrix.GOARM }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Setup build environment
run: make ci-deps
- name: "Build Linux-x64"
run: make dist GOBUILD_TAGS=crypto_plugins CGO_ENABLED=1
if: "matrix.GOOS == 'linux' && matrix.GOARCH == 'amd64'"
- name: "Build ${{ matrix.GOOS }}/${{ matrix.GOARCH }}${{ matrix.GOARM }}"
run: make binaries
if: "matrix.GOOS != 'linux' || matrix.GOARCH != 'amd64'"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: encval_${{ matrix.GOOS }}_${{ matrix.GOARCH }}${{ matrix.GOARM }}.tgz
path: encval_${{ matrix.GOOS }}_${{ matrix.GOARCH }}${{ matrix.GOARM }}.tgz
retention-days: 5
if: "matrix.GOOS == 'linux' && matrix.GOARCH == 'amd64'"
e2e:
name: End-to-End tests
runs-on: ubuntu-latest
needs: [build]
env:
ENCVAL_HOME: /opt/encval
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- uses: actions/download-artifact@v3
with:
name: encval_linux_amd64.tgz
- name: Install EYAML
run: gem install hiera-eyaml
- name: Setup environment
run: make install-dist ci-env PREFIX=${ENCVAL_HOME}
- name: Run tests
run: make -C test smoke
- name: Run EYAML compatibility tests
run: make -C test eyaml-compat
- name: Run ENCVAL compatibility tests
run: make -C test encval-compat