This repository has been archived by the owner on Mar 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
121 lines (114 loc) · 3.18 KB
/
ci.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
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
name: CI
on:
push:
branches:
- '**'
- '!dependabot/**'
pull_request: {}
jobs:
unit:
name: Unit test
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.14.x
- name: Verify code formatting
run: |
go get golang.org/x/tools/cmd/goimports
make verify-goimports
shell: bash
if: success() && runner.os != 'Windows'
- name: Build
run: make build
- name: Unit test
run: make coverage
- name: Verify docs
run: make verify-docs
- name: Report coverage
run: curl -s https://codecov.io/bash | bash -s
shell: bash
env:
CODECOV_TOKEN: d09bee7e-6c5a-4316-a48f-266e08d0f70f
stage:
name: Stage
needs: unit
if: success() && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.14.x
- name: Stage riff release artifacts
run: .github/workflows/stage.sh
env:
GCLOUD_CLIENT_SECRET: ${{ secrets.GCLOUD_CLIENT_SECRET }}
acceptance:
name: Acceptance
needs: stage
if: success() && github.event_name == 'push'
strategy:
matrix:
config:
- os: ubuntu-latest
qualifier: kind
cluster: kind
registry: dockerhub
- os: windows-latest
qualifier: windows
cluster: gke
registry: gcr
fail-fast: false
runs-on: ${{ matrix.config.os }}
env:
CLUSTER: ${{ matrix.config.cluster }}
REGISTRY: ${{ matrix.config.registry }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GCLOUD_CLIENT_SECRET: ${{ secrets.GCLOUD_CLIENT_SECRET }}
steps:
- uses: actions/[email protected]
- name: Setup env
run: |
job=$(date +%s) # TODO use something that is assigned by CI to guarantee uniqueness
echo "JOB_ID=${job}"
echo "##[set-env name=CLUSTER_NAME]cli-${job}-${{ matrix.config.qualifier }}"
echo "##[set-env name=NAMESPACE]cli-${job}-${{ matrix.config.qualifier }}"
shell: bash
- name: Run acceptance tests
run: .github/workflows/acceptance.sh
shell: bash
- name: Collect diagnostics
run: .github/workflows/diagnostics.sh
shell: bash
if: always()
- name: Cleanup
run: .github/workflows/acceptance-cleanup.sh
shell: bash
if: always()
publish:
name: Publish
needs: acceptance
if: |
success() &&
github.event_name == 'push' && (
github.ref == 'refs/heads/main' || (
startsWith(github.ref, 'refs/heads/v') && endsWith(github.ref, 'x')
)
)
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Publish riff release artifacts
run: .github/workflows/publish.sh ${{ github.ref }}
env:
GCLOUD_CLIENT_SECRET: ${{ secrets.GCLOUD_CLIENT_SECRET }}