1name: build
2
3on:
4  push:
5    branches: [ master ]
6  pull_request:
7    branches: [ master ]
8
9jobs:
10
11  build:
12    runs-on: ubuntu-latest
13    strategy:
14      matrix:
15        go: [ '1.14', '1.13' ]
16    name: Build and test on go ${{ matrix.go }}
17    steps:
18
19    - name: Set up Go ${{ matrix.go }}
20      uses: actions/setup-go@v2
21      with:
22        go-version: ${{ matrix.go }}
23      id: go
24
25    - name: Check out code
26      uses: actions/checkout@v2
27
28    - name: Install ninja
29      run: |
30        mkdir -p ${GITHUB_WORKSPACE}/ninja-bin; cd ${GITHUB_WORKSPACE}/ninja-bin
31        wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip
32        unzip ninja-linux.zip
33        rm ninja-linux.zip
34        echo "${GITHUB_WORKSPACE}/ninja-bin" >> $GITHUB_PATH
35
36    - name: Run gofmt
37      run: ./.gofmt.sh
38
39    - name: Test
40      run: go test ./...
41
42    - name: Test with race detector
43      run: go test -race -short ./...
44
45    - run: ./tests/test.sh
46    - run: ./tests/test_tree_tests.sh
47    - run: ./tests/test_tree_tests.sh -t
48