diff --git a/.github/workflows/go_latest_test.yml b/.github/workflows/go_latest_test.yml new file mode 100644 index 000000000..e17fe27b3 --- /dev/null +++ b/.github/workflows/go_latest_test.yml @@ -0,0 +1,31 @@ +name: Push Check Go-Latest-Linux-X64 + +on: push + +jobs: + build: + runs-on: [self-hosted, X64] + steps: + - name: Clear repository + run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE + + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.20 + + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: script + run: | + ./scripts/go_latest.sh master + which go + go version + GOMAXPROCS=4 go test -v -race ./... \ No newline at end of file diff --git a/scripts/go_latest.sh b/scripts/go_latest.sh new file mode 100644 index 000000000..7be422038 --- /dev/null +++ b/scripts/go_latest.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +BRANCH=$1 + +git clone https://github.com/golang/go.git go_$BRANCH + +cd go_$BRANCH/src +git checkout -b build/$BRANCH origin/$BRANCH + +./all.bash + +cd .. +export GOROOT=$(pwd) +export PATH=$GOROOT/bin:$PATH