github.com/switchupcb/yaegi@v0.10.2/.github/workflows/go-cross.yml (about) 1 name: Build Cross OS 2 3 on: 4 push: 5 branches: 6 - master 7 pull_request: 8 9 jobs: 10 11 cross: 12 name: Go 13 runs-on: ${{ matrix.os }} 14 defaults: 15 run: 16 working-directory: ${{ github.workspace }}/go/src/github.com/switchupcb/yaegi 17 18 strategy: 19 matrix: 20 go-version: [ 1.16, 1.17 ] 21 os: [ubuntu-latest, macos-latest, windows-latest] 22 23 include: 24 - os: ubuntu-latest 25 go-path-suffix: /go 26 - os: macos-latest 27 go-path-suffix: /go 28 - os: windows-latest 29 go-path-suffix: \go 30 31 steps: 32 # https://github.com/marketplace/actions/setup-go-environment 33 - name: Set up Go ${{ matrix.go-version }} 34 uses: actions/setup-go@v2 35 with: 36 go-version: ${{ matrix.go-version }} 37 38 # https://github.com/marketplace/actions/checkout 39 - name: Checkout code 40 uses: actions/checkout@v2 41 with: 42 path: go/src/github.com/switchupcb/yaegi 43 44 # https://github.com/marketplace/actions/cache 45 - name: Cache Go modules 46 uses: actions/cache@v2 47 with: 48 # In order: 49 # * Module download cache 50 # * Build cache (Linux) 51 # * Build cache (Mac) 52 # * Build cache (Windows) 53 path: | 54 ~/go/pkg/mod 55 ~/.cache/go-build 56 ~/Library/Caches/go-build 57 %LocalAppData%\go-build 58 key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} 59 restore-keys: | 60 ${{ runner.os }}-${{ matrix.go-version }}-go- 61 62 - name: Setup GOPATH 63 run: go env -w GOPATH=${{ github.workspace }}${{ matrix.go-path-suffix }} 64 65 # TODO fail on windows 66 # - name: Tests 67 # run: go test -v -cover ./... 68 # env: 69 # GOPATH: ${{ github.workspace }}${{ matrix.go-path }} 70 71 - name: Build 72 run: go build -race -v -ldflags "-s -w" -trimpath