12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- on:
- push:
- branches:
- - master
- - ci-test
- pull_request:
- branches:
- - master
- # Note that a full "go test" is quite heavy,
- # as it runs many builds under the hood.
- # The default -timeout=10m can be hit by the hosted runners.
- #
- # Also note that we don't use actions/cache for Go on purpose.
- # Caching GOMODCACHE wouldn't help much, as we have few deps.
- # Caching GOCACHE would do more harm than good,
- # as the tests redo most of their work if the garble version changes,
- # and the majority of commits or PRs will do so.
- name: Test
- jobs:
- test:
- strategy:
- matrix:
- go-version: [1.18.x]
- os: [ubuntu-latest, macos-latest, windows-latest]
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/setup-go@v3
- with:
- go-version: ${{ matrix.go-version }}
- - uses: actions/checkout@v3
- - name: Test
- run: go test -timeout=15m ./...
- - name: Test with -race
- # macos and windows tend to be a bit slower,
- # and it's rare that a race in garble would be OS-specific.
- if: matrix.os == 'ubuntu-latest'
- run: go test -race -timeout=20m ./...
- # Static checks from this point forward. Only run on one Go version and on
- # Linux, since it's the fastest platform, and the tools behave the same.
- - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- run: |
- go install
- ./scripts/check-third-party.sh
- - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- run: ./scripts/crlf-test.sh
- - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- run: diff <(echo -n) <(gofmt -d .)
- - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- run: go vet ./...
- - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
- uses: dominikh/staticcheck-action@v1
- with:
- version: "2022.1.1"
- install-go: false
- # We don't care about GOARCH=386 particularly,
- # but it helps ensure we support 32-bit hosts and targets well.
- # TODO: use CGO_ENABLED=1 once we figure out how to install gcc-multilib,
- # and once gotooltest forwards the value of CGO_ENABLED to the scripts.
- test-386:
- runs-on: ubuntu-latest
- env:
- GOARCH: 386
- steps:
- - uses: actions/setup-go@v3
- with:
- go-version: 1.18.x
- - uses: actions/checkout@v3
- - name: Test
- run: go test -timeout=15m ./...
- test-gotip:
- runs-on: ubuntu-latest
- steps:
- - name: Install Go
- env:
- GO_COMMIT: f32519e5fbcf1b12f9654a6175e5e72b09ae8f3a # 2022-07-30
- run: |
- cd $HOME
- mkdir $HOME/gotip
- cd $HOME/gotip
- wget -O gotip.tar.gz https://go.googlesource.com/go/+archive/${GO_COMMIT}.tar.gz
- tar -xf gotip.tar.gz
- echo "devel go1.19-${GO_COMMIT}" >VERSION
- cd src
- # GOGC=off helps Go build about 20% faster, if we can spare memory.
- GOGC=off ./make.bash
- echo "GOROOT=$HOME/gotip" >>$GITHUB_ENV
- echo "$HOME/gotip/bin" >>$GITHUB_PATH
- - uses: actions/checkout@v3
- - name: Test
- run: go test -timeout=15m ./...
|