You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/.github/workflows/test.yml

93 lines
2.4 KiB
YAML

on:
push:
branches:
- master
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.
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 -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 ./...
# 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 -timeout=15m ./...
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 -timeout=15m ./...
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