-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (67 loc) · 1.75 KB
/
build_and_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.23]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install mingw
go get -u github.com/go-gl/glfw/v3.3/glfw
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install glew
go get -u github.com/go-gl/gl/v4.1-core/gl
- name: Install dependencies
run: |
go mod download -x
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
make build-linux
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: |
make build-windows
- name: Build (macOS)
if: matrix.os == 'macos-latest'
run: |
make build-darwin
- name: Run tests
run: |
go test -v -coverprofile=coverage.out ./...
- name: Upload build artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-build
path: build/
- name: Upload coverage report
if: success()
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage.out