-
Notifications
You must be signed in to change notification settings - Fork 157
94 lines (94 loc) · 2.49 KB
/
main.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
85
86
87
88
89
90
91
92
93
94
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
gomod:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: make go-mod-tidy
- run: make go-mod-download
- run: tar -cvf ./src.tar.gz ./ # preserve file permissions
- uses: actions/upload-artifact@v3
with:
name: src
path: ./src.tar.gz
lint:
runs-on: ubuntu-20.04
needs: gomod
steps:
- uses: actions/download-artifact@v3
with:
name: src
- run: tar -xvf ./src.tar.gz
- run: make golint
test:
runs-on: ubuntu-20.04
needs: [gomod, lint]
strategy:
fail-fast: false
matrix:
testSuite: [test, integration-test, helm-test]
steps:
- uses: actions/download-artifact@v3
with:
name: src
- uses: helm/[email protected]
- run: tar -xvf ./src.tar.gz
- run: |
make install-csi-hostpath-driver
make install-minio
if: matrix.testSuite == 'integration-test' || matrix.testSuite == 'helm-test'
# A test (CRDSuite) that runs as part of `make test` requies atleast one CRD to
# be present on the cluster. That's why we are only installing csi-hostpath-driver
# before running `make test`, to create some CRDs on the cluster.
- run: |
make install-csi-hostpath-driver
make install-minio
if: matrix.testSuite == 'test'
- run: make ${{ matrix.testSuite }}
build:
runs-on: ubuntu-20.04
needs: [gomod, lint, test]
strategy:
matrix:
bin: [controller, kanctl, kando]
steps:
- uses: actions/download-artifact@v3
with:
name: src
- run: tar -xvf ./src.tar.gz
- run: make build BIN=${{ matrix.bin }} GOBORING=true
docs:
runs-on: ubuntu-20.04
needs: gomod
steps:
- uses: actions/download-artifact@v3
with:
name: src
- run: tar -xvf ./src.tar.gz
- run: make docs
release:
runs-on: ubuntu-20.04
needs: [test, build]
if: github.ref_name == 'master' || startsWith(github.ref, 'refs/tags')
permissions:
packages: write
steps:
- uses: actions/download-artifact@v3
with:
name: src
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: sudo rm -rf /usr/share/dotnet
- run: sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- run: tar -xvf ./src.tar.gz
- run: make release-snapshot
- run: ./build/push_images.sh