2020-06-08 03:29:51 +03:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-08-20 16:20:13 +03:00
|
|
|
- "master"
|
2020-06-08 03:29:51 +03:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
2022-08-24 19:03:59 +03:00
|
|
|
GOLANGCILINT_VERSION: 1.49.0
|
2020-06-08 03:29:51 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-12-24 19:45:02 +03:00
|
|
|
lint:
|
2020-06-08 03:29:51 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-12 22:00:13 +03:00
|
|
|
- uses: actions/setup-go@v3
|
2021-12-24 19:45:02 +03:00
|
|
|
with:
|
2022-08-03 19:03:59 +03:00
|
|
|
go-version: 1.19.0
|
2022-03-12 22:00:13 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: golangci/golangci-lint-action@v3
|
2021-12-24 19:45:02 +03:00
|
|
|
with:
|
|
|
|
version: v${{ env.GOLANGCILINT_VERSION }}
|
|
|
|
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
goarch: amd64
|
|
|
|
go_test_race_flags: -race
|
|
|
|
# build and test on 32 bit, does not support race
|
|
|
|
- os: ubuntu-latest
|
|
|
|
goarch: "386"
|
|
|
|
go_test_race_flags: ""
|
|
|
|
- os: macos-latest
|
|
|
|
goarch: amd64
|
2022-08-25 18:06:03 +03:00
|
|
|
go_test_race_flags: ""
|
2021-12-24 19:45:02 +03:00
|
|
|
- os: windows-latest
|
|
|
|
goarch: amd64
|
2022-08-25 18:06:03 +03:00
|
|
|
go_test_race_flags: ""
|
2021-12-24 19:45:02 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
# only run cli binary tests on linux
|
2021-09-18 19:11:51 +03:00
|
|
|
- name: Install expect
|
2021-12-24 19:45:02 +03:00
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
2021-09-18 19:11:51 +03:00
|
|
|
run: sudo apt-get install expect
|
2022-03-12 22:00:13 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v3
|
2020-06-08 03:29:51 +03:00
|
|
|
with:
|
2022-08-03 19:03:59 +03:00
|
|
|
go-version: 1.19.0
|
2020-06-08 03:29:51 +03:00
|
|
|
- name: Test
|
2021-12-24 19:45:02 +03:00
|
|
|
env:
|
|
|
|
GOARCH: ${{ matrix.goarch }}
|
|
|
|
GO_TEST_RACE_FLAGS: ${{ matrix.go_test_race_flags }}
|
2020-06-08 03:29:51 +03:00
|
|
|
run: make test
|