-
Notifications
You must be signed in to change notification settings - Fork 67
109 lines (103 loc) · 3.27 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
- "*/v[0-9]+.[0-9]+"
schedule:
- cron: "0 17 * * *"
concurrency:
# If a job with a concurrency group is running with cancel-in-progress, that job is cancelled when a new job with same concurrency group is started.
# In a workflow github.head_ref exists only for PRs while github.ref exists for the repo branches/tags.
# Concurrency group will be of form ${{ github.head_ref }}-ci when triggered via PR creating 1 group per PR. Older jobs are cancelled when new commits are pushed to that PR branch.
# Concurrency group will be of form ${{ github.ref }}-ci when triggered from repo branch or tag ref. Older jobs are cancelled when new jobs are triggered from that same branch/tag.
# `-ci` suffix is to namespace the concurrency group incase you want to add a group for another workflow in the future.
group: "${{ github.head_ref || github.ref }}-ci"
cancel-in-progress: true
jobs:
shell-ci:
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Lint shell scripts, ignoring third-party files
run: |
find . -name "*.sh" > shell_files.out
shellcheck $(cat shell_files.out)
ts-unit-test-ci:
strategy:
matrix:
platform: [ubuntu-latest]
node-version: [14.x]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Run unit tests
run: |
make unit-test-ts
- name: Check licenses
run: |
cd functions/ts
make check-licenses
go-unit-test-ci:
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/work/kpt-functions-catalog/functions/go
GO111MODULE: on
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Check out code into GOPATH
uses: actions/checkout@v1
with:
path: go/src/github.com/${{ github.repository }}
- name: Run unit tests
run: |
make unit-test-go
- name: Check licenses
run: |
cd functions/go
make check-licenses
e2e-ci:
timeout-minutes: 60
strategy:
matrix:
platform: [ubuntu-latest]
node-version: [14.x]
runs-on: ${{ matrix.platform }}
env:
GOPATH: /home/runner/work/kpt-functions-catalog/functions/go
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Install kpt
run: |
go install github.com/GoogleContainerTools/kpt@main
- name: Build node and Go docker images
if: matrix.platform == 'ubuntu-latest'
run: |
make build
- name: Run all tests
if: matrix.platform == 'ubuntu-latest'
run: |
make e2e-test