2022-09-21 18:32:42 +03:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
2023-03-03 13:40:09 +03:00
|
|
|
types: [opened, reopened, ready_for_review, synchronize]
|
2022-09-21 18:32:42 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- master
|
2023-03-03 13:59:32 +03:00
|
|
|
name: Test Go tip
|
2022-09-21 18:32:42 +03:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-03 13:40:09 +03:00
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.20.x
|
|
|
|
- name: Install Go tip
|
|
|
|
run: |
|
|
|
|
go install golang.org/dl/gotip@latest
|
|
|
|
gotip download
|
|
|
|
gotip version
|
|
|
|
- name: Checkout
|
2023-03-03 13:59:32 +03:00
|
|
|
uses: actions/checkout@v3
|
2023-03-03 13:40:09 +03:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- id: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod # Module download cache
|
|
|
|
~/.cache/go-build # Build cache (Linux)
|
|
|
|
key: ubuntu-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-go-
|
|
|
|
- name: Dependencies
|
|
|
|
run: gotip mod download
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
- name: Test
|
|
|
|
run: gotip test ./...
|
|
|
|
- name: Test 32 bit
|
|
|
|
env:
|
|
|
|
GOARCH: 386
|
|
|
|
run: gotip test ./...
|
|
|
|
- name: Test with race detector
|
|
|
|
run: gotip test -race ./...
|