standardized variable name #482
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: goloader Testing | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| env: | |
| GOPATH: ${{ github.workspace }} | |
| GO111MODULE: auto | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-second-version: [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26] | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| exclude: | |
| - os: macos-latest | |
| go-second-version: 8 | |
| - os: macos-latest | |
| go-second-version: 9 | |
| - os: macos-latest | |
| go-second-version: 10 | |
| - os: macos-latest | |
| go-second-version: 11 | |
| - os: macos-latest | |
| go-second-version: 12 | |
| - os: macos-latest | |
| go-second-version: 13 | |
| - os: macos-latest | |
| go-second-version: 14 | |
| - os: macos-latest | |
| go-second-version: 15 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.${{ matrix.go-second-version }}.x | |
| - name: Rename cmd/internal | |
| shell: sh | |
| run: | |
| cp -r `go env GOROOT`/src/cmd/internal `go env GOROOT`/src/cmd/objfile | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | |
| - name: Build | |
| shell: sh | |
| run: | | |
| if [ ${{ matrix.go-second-version }} -ge 23 ]; then | |
| go build --ldflags="-checklinkname=0" github.com/pkujhd/goloader/examples/loader | |
| else | |
| go build github.com/pkujhd/goloader/examples/loader | |
| fi | |
| - name: Compile const.go | |
| shell: sh | |
| run: | | |
| if [ ${{ matrix.go-second-version }} -ge 20 ]; then | |
| go list -export -deps -f '{{if .Export}}packagefile {{.ImportPath}}={{.Export}}{{end}}' $GOPATH/src/github.com/pkujhd/goloader/examples/const/const.go > importcfg | |
| go tool compile -importcfg importcfg $GOPATH/src/github.com/pkujhd/goloader/examples/const/const.go | |
| else | |
| go tool compile $GOPATH/src/github.com/pkujhd/goloader/examples/const/const.go | |
| fi | |
| - name: Compile base.go | |
| shell: sh | |
| run: | | |
| if [ ${{ matrix.go-second-version }} -ge 20 ]; then | |
| go list -export -deps -f '{{if .Export}}packagefile {{.ImportPath}}={{.Export}}{{end}}' $GOPATH/src/github.com/pkujhd/goloader/examples/base/base.go > importcfg | |
| go tool compile -importcfg importcfg $GOPATH/src/github.com/pkujhd/goloader/examples/base/base.go | |
| else | |
| go tool compile $GOPATH/src/github.com/pkujhd/goloader/examples/base/base.go | |
| fi | |
| - name: Test base.o | |
| run: | |
| ./loader -o base.o -run main.main | |
| - name: Test const.o | |
| run: | |
| ./loader -o const.o -run main.main |