-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (85 loc) · 2.19 KB
/
main.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
on:
push:
branches:
- '**'
tags-ignore:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- master
name: Stucco build
env:
CGO_ENABLED: 0
jobs:
build_cli:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
go-version: [1.18.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
goarch: [amd64, 386, arm64]
include:
- platform: ubuntu-latest
goos: linux
- platform: macos-latest
goos: darwin
- platform: windows-latest
goos: windows
ext: '.exe'
exclude:
- platform: macos-latest
goarch: 386
runs-on: ${{ matrix.platform }}
steps:
- name: setup go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: checkout
uses: actions/checkout@v1
- name: cache deps
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build tasks
run: go build -o tasks ./hack/tasks.go
- name: build cli
run: ./tasks bin/cli/${{ matrix.goos }}/${{ matrix.goarch }}/stucco${{ matrix.ext }}
- name: test
env:
CGO_ENABLED: 1
run: |
./tasks test
./tasks test-race
build_azure_function:
needs:
- build_cli
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
go-version: [1.18.x]
platform: [ubuntu-latest]
include:
- platform: ubuntu-latest
runs-on: ${{ matrix.platform }}
steps:
- name: setup go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: checkout
uses: actions/checkout@v1
- name: cache deps
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build tasks
run: go build -o tasks ./hack/tasks.go
- name: build azure function
run: ./tasks build_azure_function