Skip to content

Commit

Permalink
CI: add go latest image test
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Aug 2, 2023
1 parent d01e74c commit 2b53983
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/go_latest_test.yml
Original file line number Diff line number Diff line change
@@ -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 ./...
14 changes: 14 additions & 0 deletions scripts/go_latest.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2b53983

Please sign in to comment.