Test #557
This file contains 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: Test | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.17 | |
- name: Fetch latest Go commit | |
run: | | |
git ls-remote https://go.googlesource.com/go/ HEAD | cut -f1 | tee GO_COMMIT_HASH | |
- name: Restore Go cache | |
id: cache-gotip | |
uses: actions/[email protected] | |
with: | |
path: ~/gotip | |
key: ${{ runner.os }}-gotip-${{ hashFiles('GO_COMMIT_HASH') }} | |
- name: Install latest Go | |
if: steps.cache-gotip.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip | |
cd $HOME/gotip/src | |
./make.bash | |
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV | |
echo "$HOME/gotip/bin" >> $GITHUB_PATH | |
- name: Check out code | |
uses: actions/[email protected] | |
- name: Test | |
run: | | |
go test -coverprofile=coverage.txt -covermode=atomic ./... | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] |