-
Notifications
You must be signed in to change notification settings - Fork 188
47 lines (39 loc) · 1.3 KB
/
test-and-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
38
39
40
41
42
43
44
45
46
47
name: Build
on: push
jobs:
test-and-build:
strategy:
matrix:
include:
- platform: windows-latest
binary_name: scribblers-x64.exe
- platform: ubuntu-latest
binary_name: scribblers-linux-x64
- platform: macos-latest
binary_name: scribblers-macos-x64
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Run tests
shell: bash
run: |
go test -v -race -covermode=atomic ./...
- name: Build artifact
shell: bash
run: |
go build -trimpath -ldflags "-w -s" -o ${{ matrix.binary_name }} ./cmd/scribblers
- name: Upload build artifact
uses: actions/upload-artifact@v4
env:
# Disable CGO to get "more static" binaries. They aren't really static ...
# since it can still happen that part of the stdlib access certain libs, but
# whatever, this will probs do for our usecase. (Can't quite remember
# anymore, but I have had issues with this in the past) :D
CGO_ENABLED: 0
with:
name: ${{ matrix.binary_name }}
path: ./${{ matrix.binary_name }}