-
-
Notifications
You must be signed in to change notification settings - Fork 87
73 lines (59 loc) · 1.91 KB
/
go.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
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
updateTestdata:
description: 'Update testdata images'
required: true
default: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Set up Core
run: go install ./cmd/core && sudo apt update && core setup
- name: "Install video dependencies (TODO: move to a command)"
run: sudo add-apt-repository ppa:savoury1/ffmpeg4 && sudo apt install libswscale-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev libasound2-dev
- name: Build
run: go build -v ./...
- name: Build Docs (to verify it works on PRs)
run: core build web -dir docs -o static
- name: Download testdata
uses: dawidd6/action-download-artifact@v6
with:
name: testdata
workflow_search: true
search_artifacts: true
if_no_artifact_found: warn
- name: Set CORE_UPDATE_TESTDATA env var
if: inputs.updateTestdata
run: echo "CORE_UPDATE_TESTDATA=true" >> $GITHUB_ENV
# we can't test gpu, xyz, and system on the CI since there is no Vulkan support
- name: Test
run: go test -v $(go list ./... | grep -v gpu | grep -v xyz | grep -v system) -coverprofile cover.out -timeout 30s
- name: Upload testdata
uses: actions/upload-artifact@v4
with:
name: testdata
path: "**/testdata/**/*.png"
- name: Upload failure testdata
uses: actions/upload-artifact@v4
if: failure()
with:
name: testdata-fail
path: "**/testdata/**/*.png"
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
with:
coverage-file: cover.out
if: github.event_name == 'push'