From 1366e41eea75d35f1404a69b300f7f641e26d699 Mon Sep 17 00:00:00 2001 From: Nick Z <2420177+nickzelei@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:37:37 -0700 Subject: [PATCH 1/2] updates actions --- .github/workflows/linter.yml | 13 +++++-------- .github/workflows/release.yml | 18 +++++++++--------- .github/workflows/tests.yml | 19 ++++++++++++------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 82f1556..fc3550f 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,20 +9,17 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - uses: actions/checkout@v3 - - name: Granting private modules access run: | git config --global url."https://${{ secrets.REPO_PAT }}:x-oauth-basic@github.com/nucleuscloud".insteadOf "https://github.com/nucleuscloud" + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: version: latest - args: --timeout=3m diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00e550f..67bc87b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,15 +13,19 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Granting private modules access + run: | + git config --global url."https://${{ secrets.REPO_PAT }}:x-oauth-basic@github.com/nucleuscloud".insteadOf "https://github.com/nucleuscloud" + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: @@ -37,10 +41,6 @@ jobs: username: nickzelei password: ${{ secrets.REPO_PAT }} - - name: Granting private modules access - run: | - git config --global url."https://${{ secrets.REPO_PAT }}:x-oauth-basic@github.com/nucleuscloud".insteadOf "https://github.com/nucleuscloud" - - name: Fetch all tags run: git fetch --force --tags diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf19d21..722ccf2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,20 +9,25 @@ jobs: name: run-tests strategy: matrix: - go-version: [1.20.x] - platform: [ubuntu-latest, macos-latest] + platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v3 + - name: Granting private modules access run: | git config --global url."https://${{ secrets.REPO_PAT }}:x-oauth-basic@github.com/nucleuscloud".insteadOf "https://github.com/nucleuscloud" + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Vet + run: | + go vet ./... + - name: Test run: | - go version go test -v ./... From 05b0a46eb56cccf73266a6ef570224e78110ff9c Mon Sep 17 00:00:00 2001 From: Nick Z <2420177+nickzelei@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:40:46 -0700 Subject: [PATCH 2/2] checkout code in lint --- .github/workflows/linter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index fc3550f..5424226 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -9,6 +9,9 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Granting private modules access run: | git config --global url."https://${{ secrets.REPO_PAT }}:x-oauth-basic@github.com/nucleuscloud".insteadOf "https://github.com/nucleuscloud"