ci: remove obsolete protocol/cache-go-action #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Go Test Examples | |
jobs: | |
unit: | |
defaults: | |
run: | |
working-directory: examples | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu", "windows", "macos" ] | |
go: [ "1.19.x", "1.20.x" ] | |
env: | |
COVERAGES: "" | |
runs-on: ${{ format('{0}-latest', matrix.os) }} | |
name: ${{ matrix.os }} (go ${{ matrix.go }}) | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Go information | |
run: | | |
go version | |
go env | |
- name: Use msys2 on windows | |
if: ${{ matrix.os == 'windows' }} | |
shell: bash | |
# The executable for msys2 is also called bash.cmd | |
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells | |
# If we prepend its location to the PATH | |
# subsequent 'shell: bash' steps will use msys2 instead of gitbash | |
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH | |
- name: Run tests | |
uses: protocol/multiple-go-modules@v1.2 | |
with: | |
run: go test -shuffle=on ./... | |
- name: Run tests (32 bit) | |
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. | |
uses: protocol/multiple-go-modules@v1.2 | |
env: | |
GOARCH: 386 | |
with: | |
run: | | |
export "PATH=${{ env.PATH_386 }}:$PATH" | |
go test -shuffle=on ./... | |
- 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 | |
with: | |
run: go test -race ./... |