nightly tests #529
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This runs nightly tests once a day at 12:00 noon. | |
name: nightly tests | |
on: | |
schedule: | |
- cron: '00 12 * * *' | |
jobs: | |
nightly_test: | |
runs-on: charon-ci | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-go | |
- 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 | |
fuzz_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 # For compose to build images | |
with: | |
driver-opts: "image=moby/buildkit:v0.10.5" # avoid unknown/unknown arch in ghcr | |
- uses: ./.github/actions/setup-go | |
- 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: | | |
echo "CHARON_REPO=$(pwd)" >> $GITHUB_ENV | |
echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV | |
- run: go test -race github.com/obolnetwork/charon/testutil/compose/fuzz -v -fuzzer -sudo-perms -timeout=45m -log-dir=. | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: fuzz-test-logs | |
path: testutil/compose/fuzz/*.log | |
retention-days: 3 | |
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/action-discord@0.3.2 | |
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 | |
}] |