| 1 |
name: Go |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
lint: |
| 7 |
runs-on: ubuntu-latest |
| 8 |
strategy: |
| 9 |
fail-fast: false |
| 10 |
matrix: |
| 11 |
go-version: [1.18] |
| 12 |
steps: |
| 13 |
- uses: actions/checkout@v3 |
| 14 |
|
| 15 |
- name: Set up Go ${{ matrix.go-version }} |
| 16 |
uses: actions/setup-go@v3 |
| 17 |
with: |
| 18 |
go-version: ${{ matrix.go-version }} |
| 19 |
|
| 20 |
- name: Install goimports |
| 21 |
run: | |
| 22 |
go install golang.org/x/tools/cmd/goimports@latest |
| 23 |
export PATH="$HOME/go/bin:$PATH" |
| 24 |
|
| 25 |
- name: Install pre-commit |
| 26 |
run: pip install pre-commit |
| 27 |
|
| 28 |
- name: Lint |
| 29 |
run: pre-commit run -a |
| 30 |
|
| 31 |
build: |
| 32 |
runs-on: ubuntu-latest |
| 33 |
strategy: |
| 34 |
fail-fast: false |
| 35 |
matrix: |
| 36 |
go-version: [1.17, 1.18] |
| 37 |
|
| 38 |
steps: |
| 39 |
- uses: actions/checkout@v3 |
| 40 |
|
| 41 |
- name: Set up Go ${{ matrix.go-version }} |
| 42 |
uses: actions/setup-go@v3 |
| 43 |
with: |
| 44 |
go-version: ${{ matrix.go-version }} |
| 45 |
|
| 46 |
- name: Install libolm |
| 47 |
run: sudo apt-get install libolm-dev libolm3 |
| 48 |
|
| 49 |
- name: Build |
| 50 |
run: go build -v ./... |
| 51 |
|
| 52 |
- name: Test |
| 53 |
run: go test -v ./... |