-
Notifications
You must be signed in to change notification settings - Fork 13
92 lines (77 loc) · 2.44 KB
/
ci.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
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * 1'
env:
GOPROXY: "https://proxy.golang.org"
COVERAGE: "-coverpkg=github.com/go-latex/latex/..."
jobs:
build:
name: Build
strategy:
matrix:
go-version: [1.22.x, 1.21.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Cache-Go
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
'%LocalAppData%\go-build' # Build cache (Windows)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v3
- name: Install Linux packages
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -qq pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev xvfb xdotool
# start a virtual frame buffer
Xvfb :99 -screen 0 1920x1024x24 &
- name: Build-Linux
if: matrix.platform == 'ubuntu-latest'
run: |
go install -v $TAGS ./...
- name: Build-Windows
if: matrix.platform == 'windows-latest'
run: |
go install -v $TAGS ./...
- name: Build-Darwin
if: matrix.platform == 'macos-latest'
run: |
go install -v $TAGS ./...
- name: Test Linux
if: matrix.platform == 'ubuntu-latest'
run: |
go run ./ci/run-tests.go $TAGS -race $COVERAGE
- name: Test Windows
if: matrix.platform == 'windows-latest'
run: |
go run ./ci/run-tests.go $TAGS
- name: Test Darwin
if: matrix.platform == 'macos-latest'
run: |
go run ./ci/run-tests.go $TAGS
- name: static-check
uses: dominikh/staticcheck-action@v1
with:
install-go: false
cache-key: ${{ matrix.platform }}
version: "2023.1.5"
- name: Upload-Coverage
if: matrix.platform == 'ubuntu-latest'
uses: codecov/codecov-action@v3