-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (66 loc) · 1.98 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
name: CI
on:
pull_request:
branches: [c4t, dev]
workflow_dispatch:
# Cancel ongoing workflow runs if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
go_version: "~1.23.1"
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Update dependencies
run: git submodule update --init
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Install libolm
run: sudo apt update && sudo apt-get install -y libolm-dev
- name: build_test
shell: bash
run: ./scripts/build_test.sh
# When the golangci-lint version is updated here, also update it in scripts/lint.sh
lint:
name: Static Analysis
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Update dependencies
run: git submodule update --init
- name: Install libolm
run: sudo apt update && sudo apt-get install -y libolm-dev
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Execute linter script
shell: bash
run: ./scripts/lint.sh
go_mod_tidy:
name: Check state of go.mod and go.sum
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Update dependencies
run: git submodule update --init
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Go Mod Tidy
shell: bash
run: go mod tidy
- name: Check Clean Branch
shell: bash
run: .github/workflows/check-clean-branch.sh