-
Notifications
You must be signed in to change notification settings - Fork 107
37 lines (30 loc) · 854 Bytes
/
build.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
name: build
on:
push:
branches: [ master ]
pull_request:
paths:
- 'examples/*'
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20.0"
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Here, we simply print the exact go version, to have it as part of the
# action's output, which might be convenient.
- name: Print Go version
run: go version
- name: Build examples
run: for dir in examples/*/; do go build -o $dir/bin $dir/main.go; done