github.com/traefik/yaegi@v0.15.1/.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/traefik/yaegi 17 18 strategy: 19 matrix: 20 go-version: [ 1.19, '1.20' ] 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 stable: true 38 39 # https://github.com/marketplace/actions/checkout 40 - name: Checkout code 41 uses: actions/checkout@v2 42 with: 43 path: go/src/github.com/traefik/yaegi 44 45 # https://github.com/marketplace/actions/cache 46 - name: Cache Go modules 47 uses: actions/cache@v3 48 with: 49 # In order: 50 # * Module download cache 51 # * Build cache (Linux) 52 # * Build cache (Mac) 53 # * Build cache (Windows) 54 path: | 55 ~/go/pkg/mod 56 ~/.cache/go-build 57 ~/Library/Caches/go-build 58 %LocalAppData%\go-build 59 key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} 60 restore-keys: | 61 ${{ runner.os }}-${{ matrix.go-version }}-go- 62 63 - name: Setup GOPATH 64 run: go env -w GOPATH=${{ github.workspace }}${{ matrix.go-path-suffix }} 65 66 # TODO fail on windows 67 # - name: Tests 68 # run: go test -v -cover ./... 69 # env: 70 # GOPATH: ${{ github.workspace }}${{ matrix.go-path }} 71 72 - name: Build 73 run: go build -race -v -ldflags "-s -w" -trimpath