gatus/.github/workflows/build.yml

32 lines
987 B
YAML
Raw Normal View History

2020-04-10 22:50:29 +02:00
name: build
on:
pull_request:
paths-ignore:
- '*.md'
push:
branches:
- master
paths-ignore:
- '*.md'
2019-09-06 06:08:29 +02:00
jobs:
2020-04-10 22:35:55 +02:00
build:
2022-06-18 18:50:31 +02:00
name: build
2019-09-06 06:08:29 +02:00
runs-on: ubuntu-latest
2020-04-10 22:50:29 +02:00
timeout-minutes: 5
2019-09-06 06:08:29 +02:00
steps:
2022-06-18 19:06:24 +02:00
- uses: actions/setup-go@v3
2019-09-09 03:30:21 +02:00
with:
2022-03-26 07:15:32 +01:00
go-version: 1.18
2022-06-18 19:06:24 +02:00
- uses: actions/checkout@v3
2020-04-10 22:50:29 +02:00
- name: Build binary to make sure it works
2019-09-09 03:30:21 +02:00
run: go build -mod vendor
2020-04-10 22:50:29 +02:00
- name: Test
2021-01-19 05:52:48 +01:00
# We're using "sudo" because one of the tests leverages ping, which requires super-user privileges.
2021-02-03 05:06:34 +01:00
# As for the 'env "PATH=$PATH" "GOROOT=$GOROOT"', we need it to use the same "go" executable that
# was configured by the "Set up Go" step (otherwise, it'd use sudo's "go" executable)
2021-07-19 04:04:49 +02:00
run: sudo env "PATH=$PATH" "GOROOT=$GOROOT" go test -mod vendor ./... -race -coverprofile=coverage.txt -covermode=atomic
2020-10-22 05:05:11 +02:00
- name: Codecov
uses: codecov/codecov-action@v2.1.0
2020-10-22 05:05:11 +02:00
with:
files: ./coverage.txt