From d9e12b8189e62eeb2556ad25573c944a00999bea Mon Sep 17 00:00:00 2001 From: phuslu Date: Wed, 24 Apr 2024 21:22:24 +0800 Subject: [PATCH] update workflows --- .github/workflows/build.yml | 16 +++++++++++----- .github/workflows/lint.yml | 7 +++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 428519b2..ecef2f8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,10 +8,16 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + go_version: ['tip', '1.22', '1.21', '1.20', '1.19', '1.18'] steps: + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go_version }} + check-latest: true + - uses: actions/checkout@v4 - name: Build - run: | - git clone --depth=1 https://github.com/${GITHUB_REPOSITORY} - cd $(basename ${GITHUB_REPOSITORY}) - go build -v -race - go test -v + run: go build -v -race + - name: Test + run: go test -v diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 32cdc05f..882ac86b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,9 +13,8 @@ jobs: with: go-version: '1.22' check-latest: true + - uses: actions/checkout@v4 - name: Lint run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.56.2 - git clone --depth=1 https://github.com/${GITHUB_REPOSITORY} - cd $(basename ${GITHUB_REPOSITORY}) - ../bin/golangci-lint run + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.2 + ./bin/golangci-lint run