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 0ae1bf2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/go_latest_test.yml
@@ -0,0 +1,28 @@
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.x

- 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
18 changes: 18 additions & 0 deletions scripts/go_latest.sh
@@ -0,0 +1,18 @@
#!/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
go version

cd ..
GOMAXPROCS=4 go test -v -race ./...

0 comments on commit 0ae1bf2

Please sign in to comment.