Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
use msys2 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Nov 12, 2021
1 parent 3c96e0a commit 02fc1fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
8 changes: 4 additions & 4 deletions templates/.github/workflows/go-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
24 changes: 15 additions & 9 deletions templates/.github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit 02fc1fd

Please sign in to comment.