Skip to content

Test

Test #557

Workflow file for this run

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]