From 02fc1fdd308dbd70642d7b5eb4d092181e4822ef Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 12 Nov 2021 11:55:26 +0400 Subject: [PATCH] use msys2 on Windows --- templates/.github/workflows/go-check.yml | 8 ++++---- templates/.github/workflows/go-test.yml | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/templates/.github/workflows/go-check.yml b/templates/.github/workflows/go-check.yml index 2cb5dd83..3140bf06 100644 --- a/templates/.github/workflows/go-check.yml +++ b/templates/.github/workflows/go-check.yml @@ -26,7 +26,7 @@ jobs: - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@df71e5d0e0ed317ebf43e6e59cf919430fa4b8f2 # 2021.1.1 (v0.2.1) - name: Check that go.mod is tidy - uses: protocol/multiple-go-modules@v1.2 + uses: protocol/multiple-go-modules@v1.3 with: run: | go mod tidy @@ -45,18 +45,18 @@ jobs: fi - name: go vet if: ${{ success() || failure() }} # run this step even if the previous one failed - uses: protocol/multiple-go-modules@v1.2 + uses: protocol/multiple-go-modules@v1.3 with: run: go vet ./... - name: staticcheck if: ${{ success() || failure() }} # run this step even if the previous one failed - uses: protocol/multiple-go-modules@v1.2 + uses: protocol/multiple-go-modules@v1.3 with: run: | set -o pipefail staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g' - name: go generate - uses: protocol/multiple-go-modules@v1.2 + uses: protocol/multiple-go-modules@v1.3 if: (success() || failure()) && env.RUNGOGENERATE == 'true' with: run: | diff --git a/templates/.github/workflows/go-test.yml b/templates/.github/workflows/go-test.yml index ceca1cb5..1747963c 100644 --- a/templates/.github/workflows/go-test.yml +++ b/templates/.github/workflows/go-test.yml @@ -6,12 +6,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ "ubuntu", "windows", "macos" ] go: [ "1.16.x", "1.17.x" ] + os: + - { name: "ubuntu", shell: "bash" } + - { name: "macos", shell: "bash" } + - { name: "windows", shell: "msys2 {0}" } env: COVERAGES: "" - runs-on: ${{ matrix.os }}-latest - name: ${{ matrix.os}} (go ${{ matrix.go }}) + runs-on: ${{ matrix.os.name }}-latest + name: ${{ matrix.os.name }} (go ${{ matrix.go }}) steps: - uses: actions/checkout@v2 with: @@ -27,19 +30,22 @@ jobs: uses: ./.github/actions/go-test-setup if: hashFiles('./.github/actions/go-test-setup') != '' - name: Run tests - uses: protocol/multiple-go-modules@v1.2 + uses: protocol/multiple-go-modules@v1.3 + shell: ${{ matrix.os.shell }} with: run: go test -v -coverprofile module-coverage.txt ./... - name: Run tests (32 bit) - if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. - uses: protocol/multiple-go-modules@v1.2 + if: ${{ matrix.os.name != 'macos' }} # can't run 32 bit tests on OSX. + uses: protocol/multiple-go-modules@v1.3 + shell: ${{ matrix.os.shell }} env: GOARCH: 386 with: run: go test -v ./... - name: Run tests with race detector - if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow - uses: protocol/multiple-go-modules@v1.2 + if: ${{ matrix.os.name == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow + uses: protocol/multiple-go-modules@v1.3 + shell: ${{ matrix.os.shell }} with: run: go test -v -race ./... - name: Collect coverage files @@ -49,4 +55,4 @@ jobs: uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2 with: files: '${{ env.COVERAGES }}' - env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }} + env_vars: OS=${{ matrix.os.name }}, GO=${{ matrix.go }}