1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-14 11:58:04 +00:00
twin-gatus/.github/workflows/test.yml

35 lines
1 KiB
YAML
Raw Normal View History

2022-11-16 02:51:40 +00:00
name: test
2020-04-10 20:50:29 +00:00
on:
pull_request:
paths-ignore:
- '*.md'
- '.examples/**'
2020-04-10 20:50:29 +00:00
push:
branches:
- master
paths-ignore:
- '*.md'
- '.github/**'
- '.examples/**'
2019-09-06 04:08:29 +00:00
jobs:
2022-11-16 02:51:40 +00:00
test:
2019-09-06 04:08:29 +00:00
runs-on: ubuntu-latest
timeout-minutes: 10
2019-09-06 04:08:29 +00:00
steps:
- uses: actions/setup-go@v5
2019-09-09 01:30:21 +00:00
with:
go-version: 1.22.2
- uses: actions/checkout@v4
2020-04-10 20:50:29 +00:00
- name: Build binary to make sure it works
2022-11-16 02:51:40 +00:00
run: go build
2020-04-10 20:50:29 +00:00
- name: Test
2021-01-19 04:52:48 +00:00
# We're using "sudo" because one of the tests leverages ping, which requires super-user privileges.
2021-02-03 04:06:34 +00: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)
2022-11-16 02:51:40 +00:00
run: sudo env "PATH=$PATH" "GOROOT=$GOROOT" go test ./... -race -coverprofile=coverage.txt -covermode=atomic
2020-10-22 03:05:11 +00:00
- name: Codecov
uses: codecov/codecov-action@v4.5.0
2020-10-22 03:05:11 +00:00
with:
files: ./coverage.txt
2024-04-09 22:53:15 +00:00
token: ${{ secrets.CODECOV_TOKEN }}