-
Notifications
You must be signed in to change notification settings - Fork 73
104 lines (89 loc) · 2.27 KB
/
main.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
93
94
95
96
97
98
99
100
101
102
103
104
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
go_version:
- 1.16
- 1.17
os:
- macos
- ubuntu
arch:
- 386
- amd64
exclude:
- os: macos
arch: 386
name: tests (${{ matrix.os }}/go-${{ matrix.go_version }}-${{ matrix.arch }})
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/[email protected]
id: go
with:
stable: false
go-version: ${{ matrix.go_version }}
- uses: actions/[email protected]
- name: install build deps (macos)
if: ${{ matrix.os == 'macos' }}
run: |
brew update
brew install coreutils redis
- name: install build deps (ubuntu)
if: ${{ matrix.os == 'ubuntu' }}
run: |
sudo apt update -y
sudo apt install -y redis-server
# only need to do this on macos because on Ubuntu Redis will run as a service.
- name: start redis
if: ${{ matrix.os == 'macos' }}
run: |
brew services start redis
timeout 10 sh -c "while ! redis-cli ping; do echo waiting for redis-server to start; sleep 1; done"
- name: run-tests-race
if: ${{ matrix.arch == 'amd64' }}
env:
GOARCH: "${{ matrix.arch }}"
REDIS_HOST: redis
run: go test -race -vet all -mod readonly ./...
- name: run-tests
if: ${{ matrix.arch == '386' }}
env:
GOARCH: "${{ matrix.arch }}"
REDIS_HOST: redis
run: go test -vet all -mod readonly ./...
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: golangci/[email protected]
build-artifact:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
id: go
with:
go-version: 1.17
- name: go-build
run: go build -o video-transcoding-api
env:
CGO_ENABLED: 0
unblock-pr:
name: unblock-pr
runs-on: ubuntu-latest
needs:
- build-artifact
- lint
- test
steps:
- run: "true"