Skip to content

CI - Nightly Test Suite #163

CI - Nightly Test Suite

CI - Nightly Test Suite #163

Workflow file for this run

name: CI - Nightly Test Suite
on:
schedule:
- cron: "37 3 * * *" # Run at 3:37 AM UTC daily
workflow_dispatch:
env:
CI_E2E_FILENAME: "rel-nightly"
CHANNEL: nightly
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
jobs:
test_nightly:
runs-on: "ubuntu-24.04"
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
services:
postgres:
image: postgres:13.11-bullseye
env:
POSTGRES_PASSWORD: pgpass
POSTGRES_USER: pguser
POSTGRES_DB: mydb
ports:
- 5555:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt update
sudo NEEDRESTART_MODE=a apt -y install python3 python3-pip python3-setuptools python3-wheel libboost-math-dev libffi-dev
pip3 install -r misc/requirements.txt
pip3 install e2e_tests/
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Check formatting
run: test -z "$(go fmt ./...)"
- name: Run linter
run: make lint
- name: Run build check
run: make check
- name: Set up test environment
run: |
echo 'TEST_PG=host=localhost user=pguser password=pgpass dbname=mydb port=5555 sslmode=disable' >> $GITHUB_ENV
echo 'TEST_FLAG=-p 1' >> $GITHUB_ENV
- name: Run tests
run: make test
timeout-minutes: 15
- name: Run test-generate
run: make test-generate
- name: Install go-algorand ${{ env.CHANNEL }} binaries
run: |
wget https://raw.githubusercontent.com/algorand/go-algorand/rel/stable/cmd/updater/update.sh && chmod 744 update.sh
./update.sh -i -c ${{ env.CHANNEL }} -n -d ./ -p /usr/local/go/bin
export GOPATH=/usr/local/go/
- name: Run e2e tests (nightly)
run: |
make e2e
make e2e-filter-test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
flags: nightly
name: codecov-nightly
- name: Notify Slack on failure
if: failure() && env.SLACK_WEBHOOK != ''
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: webhook-trigger
payload: |
{
"text": "🚨 Indexer Failure Alert",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "test_nightly Job Failure:\n* Branch: `${{ github.ref_name }}`\n* Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
indexer_vs_algod_nightly:
runs-on: "ubuntu-24.04"
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetch full history
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt update
sudo NEEDRESTART_MODE=a apt -y install python3 python3-pip python3-setuptools python3-wheel libboost-math-dev libffi-dev docker-compose
pip3 install -r misc/requirements.txt
pip3 install e2e_tests/
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Run indexer vs algod tests
run: make indexer-v-algod
- name: Notify Slack on failure
if: failure() && env.SLACK_WEBHOOK != ''
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: webhook-trigger
payload: |
{
"text": "🚨 Indexer Failure Alert",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "indexer_vs_algod_nightly Job Failure:\n* Branch: `${{ github.ref_name }}`\n* Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}