generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 22
88 lines (73 loc) · 2.77 KB
/
commit.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
# `name` value will appear "as is" in the badge.
# See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
# yamllint --format github .github/workflows/commit.yaml
---
name: "build"
on:
push: # We run tests on non-tagged pushes to main
tags: ''
branches: main
paths-ignore:
- '**/*.md'
pull_request: # We also run tests on pull requests targeted at the main branch.
branches: main
paths-ignore:
- '**/*.md'
# workflow_dispatch will let us manually trigger the workflow from GitHub actions dashboard.
# For example, you can try to build a branch without raising a pull request.
# See https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
- "1.20"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: false # cache separately to include golangci-lint
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
~/go/bin
key: check-${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum', 'Makefile') }}
- run: make check
test:
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
- "1.20"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: make test
test-guest:
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: # Note: Go only supports 2 versions: https://go.dev/doc/devel/release#policy
- "1.20"
tinygo-version: # Note: TinyGo only supports latest: https://github.com/tinygo-org/tinygo/releases
- "0.28.1" # Latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: "Set up TinyGo"
run: | # Installing via curl so commands are similar on OS/x
tinygo_version=${{ matrix.tinygo-version }}
curl -sSL https://github.com/tinygo-org/tinygo/releases/download/v${tinygo_version}/tinygo${tinygo_version}.linux-amd64.tar.gz | sudo tar -C /usr/local -xzf -
echo "TINYGOROOT=/usr/local/tinygo" >> $GITHUB_ENV
echo "/usr/local/tinygo/bin" >> $GITHUB_PATH
- run: make test-guest