-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.64 KB
/
ci-ubuntu.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
name: Build & Test under Ubuntu
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.15
uses: actions/setup-go@v2
with:
go-version: ^1.15
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: ~/go/pkg/mod/
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Test
run: go test -v ./tests/
- name: Build for linux
run: |
GOOS=linux GOARCH=amd64 go build -o "./bin/go-radio-$GITHUB_SHA-linux-amd64" .
GOOS=linux GOARCH=386 go build -o "./bin/go-radio-$GITHUB_SHA-linux-386" .
GOOS=linux GOARCH=arm go build -o "./bin/go-radio-$GITHUB_SHA-linux-arm" .
- name: Upload amd64 build
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }} for linux amd64
path: ${{ github.workspace }}/bin/go-radio-${{ github.sha }}-linux-amd64
- name: Upload 386 build
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }} for linux 386
path: ${{ github.workspace }}/bin/go-radio-${{ github.sha }}-linux-386
- name: Upload arm build
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }} for linux arm
path: ${{ github.workspace }}/bin/go-radio-${{ github.sha }}-linux-arm