forked from hashicorp/raft
-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (84 loc) · 2.37 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
name: ci
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
tags: ["*"]
permissions:
contents: read
jobs:
go-fmt-and-vet:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.20'
cache: true
- run: |
files=$(go fmt ./...)
if [ -n "$files" ]; then
echo "The following file(s) do not conform to go fmt:"
echo "$files"
exit 1
fi
- run: |
PACKAGE_NAMES=$(go list ./... | grep -v github.com/hashicorp/raft/fuzzy)
go vet $PACKAGE_NAMES
go-test:
needs: go-fmt-and-vet
strategy:
matrix:
go: ['1.19', '1.20']
arch: ['x32', 'x64']
runs-on: ubuntu-22.04
env:
INTEG_TESTS: yes
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ matrix.go }}
architecture: ${{ matrix.arch }}
cache: true
# x86 specific build.
- if: matrix.arch == 'x32'
run: |
sudo apt-get update
sudo apt-get install gcc-multilib
go test --tags batchtest ./...
# x86-64 specific build.
- if: matrix.arch == 'x64'
run: go test -race --tags batchtest ./...
go-test-compat:
needs: go-test
strategy:
matrix:
go: [ '1.20', '1.21', '1.22' ]
arch: [ 'x32', 'x64' ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ matrix.go }}
architecture: ${{ matrix.arch }}
cache: true
submodules: true
# x86 specific build.
- if: matrix.arch == 'x32'
run: |
sudo apt-get update
sudo apt-get install gcc-multilib
git submodule update --init --recursive
cd raft-compat
go mod tidy
go test ./...
# x86-64 specific build.
- if: matrix.arch == 'x64'
run: |
git submodule update --init --recursive
cd raft-compat
go mod tidy
go test -race ./...