on: push: branches: - master pull_request: branches: - master name: Test jobs: test: strategy: matrix: go-version: [1.17.x] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v2 - name: Test run: | go env go test ./... - 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. # also note that this can take 5-10m, so use a larger timeout. if: matrix.os == 'ubuntu-latest' run: | go test -race -timeout=20m ./... # 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: - name: Install Go uses: actions/setup-go@v2 with: go-version: 1.17.x - name: Checkout code uses: actions/checkout@v2 - name: Test run: | go env go test ./... test-gotip: runs-on: ubuntu-latest continue-on-error: true # master may not be as stable steps: - name: Install Go env: GO_COMMIT: b357b05b70d2b8c4988ac2a27f2af176e7a09e1b # 2021-12-21 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.18-${GO_COMMIT}" >VERSION cd src ./make.bash echo "GOROOT=$HOME/gotip" >>$GITHUB_ENV echo "$HOME/gotip/bin" >>$GITHUB_PATH - name: Checkout code uses: actions/checkout@v2 - name: Test run: | go env go test ./... code-checks: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Test that only LF line endings are used run: ./scripts/crlf-test.sh