From a56e914e72838f8ba013f750ccb71ff6d5d25529 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Sun, 5 Jun 2022 12:50:36 -0700 Subject: [PATCH] .github: run lint only on Go 1.18 --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++-------- Makefile | 4 ++-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ab6c0d..e9751cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,17 +1,13 @@ on: [push, pull_request] name: Test jobs: - test: - strategy: - matrix: - go-version: [1.17.x, 1.18.x] - platform: [ubuntu-latest] - runs-on: ${{ matrix.platform }} + lint: + runs-on: ubuntu-latest steps: - name: Install Go uses: WillAbides/setup-go-faster@main with: - go-version: ${{ matrix.go-version }} + go-version: 1.18.x - uses: actions/checkout@v2 with: path: './src/github.com/kevinburke/ssh_config' @@ -21,5 +17,26 @@ jobs: echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV - name: Run tests - run: make lint race-test + run: make lint + working-directory: './src/github.com/kevinburke/ssh_config' + + test: + strategy: + matrix: + go-version: [1.17.x, 1.18.x] + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: WillAbides/setup-go-faster@main + with: + go-version: ${{ matrix.go-version }} + - uses: actions/checkout@v2 + with: + path: './src/github.com/kevinburke/ssh_config' + - run: | + echo "GO111MODULE=off" >> $GITHUB_ENV + echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV + echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV + - name: Run tests with race detector on + run: make race-test working-directory: './src/github.com/kevinburke/ssh_config' diff --git a/Makefile b/Makefile index df7ee72..02e15ec 100644 --- a/Makefile +++ b/Makefile @@ -9,11 +9,11 @@ lint: $(STATICCHECK) go vet ./... $(STATICCHECK) -test: lint +test: @# the timeout helps guard against infinite recursion go test -timeout=250ms ./... -race-test: lint +race-test: go test -timeout=500ms -race ./... $(BUMP_VERSION):