forked from canonical/microcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (55 loc) · 1.49 KB
/
tests.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
name: Tests
on:
pull_request:
push:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-tests:
name: Code
runs-on: ubuntu-22.04
strategy:
matrix:
go: ["1.22.x"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v4
if: github.event_name == 'pull_request'
- name: Install Go (${{ matrix.go }})
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check compatibility with min Go version (${{ matrix.go }})
run: |
set -eux
GOMIN="$(sed -n 's/^GOMIN=\([0-9.]\+\)$/\1/p' Makefile)"
go mod tidy -go="${GOMIN}"
- name: Install dependencies
run: |
set -eux
sudo add-apt-repository ppa:dqlite/dev -y --no-update
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
libdqlite-dev \
shellcheck
- name: Run static analysis
run: |
set -eux
make check-static
make -C example check-static
- name: Unit tests (all)
run: |
set -eux
make check-unit
make -C example check-unit
- name: Example system tests
run: |
set -eux
make -C example
cd example/test
CLUSTER_VERBOSE=1 ./main.sh