-
Notifications
You must be signed in to change notification settings - Fork 101
42 lines (40 loc) · 1.38 KB
/
nightly-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This runs nightly tests once a day at 12:00 noon.
name: nightly tests
on:
schedule:
- cron: '00 12 * * *'
jobs:
nightly_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.5'
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go test -v -timeout=90m -race github.com/obolnetwork/charon/testutil/integration -nightly
notify_failure:
runs-on: ubuntu-latest
needs: [ nightly_test ]
# Syntax ref: https://github.com/actions/runner/issues/1251
if: always() && github.ref == 'refs/heads/main' && contains(join(needs.*.result, ','), 'failure')
steps:
- name: notify failure
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: GitHub
DISCORD_AVATAR: https://avatars.githubusercontent.com/u/583231
DISCORD_EMBEDS: |
[{
"title": "🚨 Nightly tests failed: ${{ github.workflow }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"color": 10038562
}]