-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (35 loc) · 1006 Bytes
/
buildandtest.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
name: build and test
on:
push:
branches:
- master
pull_request:
branches:
- master
- develop
permissions:
contents: read
jobs:
buildandtest:
name: Build and Test on Go ${{matrix.go}}
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 'stable', 'oldstable' ]
steps:
- run: |
sudo docker version
sudo docker -H unix:///proc/1/root/run/docker.sock version
- name: Set up Go ${{matrix.go}}
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # pin@v4
with:
go-version: ${{matrix.go}}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test Go packages as root
run: go test -v -p 1 -exec sudo ./...
- name: Test Go packages as ordinary user
run: go test -v -p 1 ./...