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:
|
2023-03-26 19:03:37 +03:00
|
|
|
GOLANGCILINT_VERSION: "1.52.2"
|
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:
|
2023-03-08 19:03:51 +03:00
|
|
|
go-version: "1.20.2"
|
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
|
2022-09-09 10:15:18 +03:00
|
|
|
test_target: test-race
|
2021-12-24 19:45:02 +03:00
|
|
|
# build and test on 32 bit, does not support race
|
|
|
|
- os: ubuntu-latest
|
|
|
|
goarch: "386"
|
2022-09-09 10:15:18 +03:00
|
|
|
test_target: test
|
2021-12-24 19:45:02 +03:00
|
|
|
- os: macos-latest
|
|
|
|
goarch: amd64
|
2022-09-09 10:15:18 +03:00
|
|
|
test_target: test
|
2021-12-24 19:45:02 +03:00
|
|
|
- os: windows-latest
|
|
|
|
goarch: amd64
|
2022-09-09 10:15:18 +03:00
|
|
|
test_target: test
|
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:
|
2023-03-08 19:03:51 +03:00
|
|
|
go-version: "1.20.2"
|
2020-06-08 03:29:51 +03:00
|
|
|
- name: Test
|
2021-12-24 19:45:02 +03:00
|
|
|
env:
|
|
|
|
GOARCH: ${{ matrix.goarch }}
|
2022-09-09 10:15:18 +03:00
|
|
|
run: make ${{ matrix.test_target }}
|