-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (43 loc) · 1.23 KB
/
go-test.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
name: go test
on: [push]
jobs:
sdk-go-build-test:
runs-on: ubuntu-latest
# Use a matrix strategy to test all the modules simultaneously.
strategy:
fail-fast: false
matrix:
MOD_PATH:
[
./,
./measure/google,
./measure/here,
./measure/osrm,
./measure/routingkit,
]
steps:
# Checks out the changes.
- name: git clone
uses: actions/checkout@v4
# Determines the Go version to use.
- name: determine Go version
run: |
export GO_VERSION=$(cat workflow-configuration.yml | yq '.go-version' -r)
echo "Using Go version $GO_VERSION"
echo "GO_VERSION=${GO_VERSION}" >> $GITHUB_ENV
# Sets up Go with the version set before.
- name: set up go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
**/go.sum
**/go.mod
# Builds the Go code.
- name: go build
run: go build -v ./...
working-directory: ${{ matrix.MOD_PATH }}
# Runs the Go tests.
- name: go test
run: go test ./...
working-directory: ${{ matrix.MOD_PATH }}