github.com/eh-steve/goloader@v0.0.0-20240111193454-90ff3cfdae39/.github/workflows/go.yml (about)

     1  name: goloader
     2  
     3  on:
     4    push:
     5      branches: [ master ]
     6    pull_request:
     7      branches: [ master ]
     8  
     9  jobs:    
    10    build:
    11      env:
    12        GOPATH: ${{ github.workspace }}
    13        GO111MODULE: auto
    14      strategy:
    15        fail-fast: false
    16        matrix:
    17          go-version: [ 1.18.X, 1.19.X, 1.20.X , 1.21.X ]
    18          os:  [ubuntu-latest, windows-latest, macos-latest, [self-hosted, Linux, ARM64], [self-hosted, macOS, ARM64]]
    19          cgo-enabled: ["CGO_ENABLED=0", "CGO_ENABLED=1"]
    20          dynlink: ["JIT_GC_DYNLINK=1", "JIT_GC_DYNLINK=0"]
    21      runs-on: ${{ matrix.os }}
    22  
    23      steps:
    24      - name: Set up Go
    25        uses: actions/setup-go@v4
    26        with:
    27          go-version: ${{ matrix.go-version }}
    28          check-latest: true
    29          cache-dependency-path: jit/go.sum
    30  
    31      - name: Rename cmd/internal
    32        shell: sh
    33        run: |
    34          eval $(go env | sed -r 's/^(set )?(\w+)=("|'"'"'?)(.*)\3$/\2="\4"/g') && cp -r $GOROOT/src/cmd/internal $GOROOT/src/cmd/objfile
    35  
    36      - name: Patch gc
    37        shell: sh
    38        run:
    39          go run -a github.com/eh-steve/goloader/jit/patchgc@2aedbae4eb66fb4d0a4f24efbeb1873007792bca
    40  
    41      - name: Checkout code
    42        uses: actions/checkout@v3
    43        with:
    44          path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
    45  
    46      - name: Test
    47        shell: sh
    48        run:
    49          cd $GOPATH/src/github.com/eh-steve/goloader/jit && export ${{ matrix.cgo-enabled }} ${{ matrix.dynlink }} && go test -a -c . && ./jit.test -test.v