-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 935 Bytes
/
build.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
name: Build and test
on:
- push
- pull_request
jobs:
linux:
name: Build ${{ matrix.os }} ${{ matrix.arch}}
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
arch:
- i386
- amd64
- arm64
os:
- darwin
- windows
- linux
exclude:
- os: windows
arch: i386
- os: darwin
arch: i386
runs-on: ubuntu-latest
container:
image: golang:1.21
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up user
run: |
useradd -m -g users testuser
chown -R testuser:users .
- name: Build for ${{ matrix.arch }} ${{ matrix.os }}
run: |
su -c "GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -v -o binary-${{ matrix.os }}-${{ matrix.arch }}" testuser