|
| 1 | +name: CI - Nightly Test Suite |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "37 3 * * *" # Run at 3:37 AM UTC daily |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +env: |
| 9 | + GO_VERSION: "1.23.3" |
| 10 | + CI_E2E_FILENAME: "rel-nightly" |
| 11 | + CHANNEL: nightly |
| 12 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + test_nightly: |
| 16 | + runs-on: "ubuntu-24.04" |
| 17 | + if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' |
| 18 | + |
| 19 | + services: |
| 20 | + postgres: |
| 21 | + image: postgres:13.11-bullseye |
| 22 | + env: |
| 23 | + POSTGRES_PASSWORD: pgpass |
| 24 | + POSTGRES_USER: pguser |
| 25 | + POSTGRES_DB: mydb |
| 26 | + ports: |
| 27 | + - 5555:5432 |
| 28 | + options: >- |
| 29 | + --health-cmd pg_isready |
| 30 | + --health-interval 10s |
| 31 | + --health-timeout 5s |
| 32 | + --health-retries 5 |
| 33 | +
|
| 34 | + steps: |
| 35 | + - name: Checkout code |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + fetch-depth: 0 # Fetch full history |
| 39 | + - name: Set up Go |
| 40 | + uses: actions/setup-go@v4 |
| 41 | + with: |
| 42 | + go-version: ${{ env.GO_VERSION }} |
| 43 | + - name: Set up Python |
| 44 | + uses: actions/setup-python@v4 |
| 45 | + with: |
| 46 | + python-version: '3.x' |
| 47 | + - name: Install dependencies |
| 48 | + run: | |
| 49 | + sudo apt update |
| 50 | + sudo NEEDRESTART_MODE=a apt -y install python3 python3-pip python3-setuptools python3-wheel libboost-math-dev libffi-dev |
| 51 | + pip3 install -r misc/requirements.txt |
| 52 | + pip3 install e2e_tests/ |
| 53 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 54 | + echo "/usr/local/go/bin" >> $GITHUB_PATH |
| 55 | + - name: Install golangci-lint |
| 56 | + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0 |
| 57 | + - name: Check formatting |
| 58 | + run: test -z "$(go fmt ./...)" |
| 59 | + - name: Run linter |
| 60 | + run: make lint |
| 61 | + - name: Run build check |
| 62 | + run: make check |
| 63 | + - name: Set up test environment |
| 64 | + run: | |
| 65 | + echo 'TEST_PG=host=localhost user=pguser password=pgpass dbname=mydb port=5555 sslmode=disable' >> $GITHUB_ENV |
| 66 | + echo 'TEST_FLAG=-p 1' >> $GITHUB_ENV |
| 67 | + - name: Run tests |
| 68 | + run: make test |
| 69 | + timeout-minutes: 15 |
| 70 | + - name: Run test-generate |
| 71 | + run: make test-generate |
| 72 | + - name: Install go-algorand ${{ env.CHANNEL }} binaries |
| 73 | + run: | |
| 74 | + wget https://raw.githubusercontent.com/algorand/go-algorand/rel/stable/cmd/updater/update.sh && chmod 744 update.sh |
| 75 | + ./update.sh -i -c ${{ env.CHANNEL }} -n -d ./ -p /usr/local/go/bin |
| 76 | + export GOPATH=/usr/local/go/ |
| 77 | + - name: Run e2e tests (nightly) |
| 78 | + run: | |
| 79 | + make e2e |
| 80 | + make e2e-filter-test |
| 81 | + - name: Upload coverage to Codecov |
| 82 | + uses: codecov/codecov-action@v3 |
| 83 | + with: |
| 84 | + file: ./coverage.txt |
| 85 | + flags: nightly |
| 86 | + name: codecov-nightly |
| 87 | + - name: Notify Slack on failure |
| 88 | + if: failure() && env.SLACK_WEBHOOK != '' |
| 89 | + uses: slackapi/slack-github-action@v2.1.0 |
| 90 | + with: |
| 91 | + webhook: ${{ secrets.SLACK_WEBHOOK }} |
| 92 | + webhook-type: webhook-trigger |
| 93 | + payload: | |
| 94 | + { |
| 95 | + "text": "🚨 Indexer Failure Alert", |
| 96 | + "blocks": [ |
| 97 | + { |
| 98 | + "type": "section", |
| 99 | + "text": { |
| 100 | + "type": "mrkdwn", |
| 101 | + "text": "test_nightly Job Failure:\n* Branch: `${{ github.ref_name }}`\n* Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
| 102 | + } |
| 103 | + } |
| 104 | + ] |
| 105 | + } |
| 106 | +
|
| 107 | + indexer_vs_algod_nightly: |
| 108 | + runs-on: "ubuntu-24.04" |
| 109 | + if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' |
| 110 | + |
| 111 | + steps: |
| 112 | + - name: Checkout code |
| 113 | + uses: actions/checkout@v4 |
| 114 | + with: |
| 115 | + submodules: recursive |
| 116 | + fetch-depth: 0 # Fetch full history |
| 117 | + - name: Set up Go |
| 118 | + uses: actions/setup-go@v4 |
| 119 | + with: |
| 120 | + go-version: ${{ env.GO_VERSION }} |
| 121 | + - name: Set up Python |
| 122 | + uses: actions/setup-python@v4 |
| 123 | + with: |
| 124 | + python-version: '3.x' |
| 125 | + - name: Install dependencies |
| 126 | + run: | |
| 127 | + sudo apt update |
| 128 | + sudo NEEDRESTART_MODE=a apt -y install python3 python3-pip python3-setuptools python3-wheel libboost-math-dev libffi-dev docker-compose |
| 129 | + pip3 install -r misc/requirements.txt |
| 130 | + pip3 install e2e_tests/ |
| 131 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 132 | + echo "/usr/local/go/bin" >> $GITHUB_PATH |
| 133 | + - name: Run indexer vs algod tests |
| 134 | + run: make indexer-v-algod |
| 135 | + - name: Notify Slack on failure |
| 136 | + if: failure() && env.SLACK_WEBHOOK != '' |
| 137 | + uses: slackapi/slack-github-action@v2.1.0 |
| 138 | + with: |
| 139 | + webhook: ${{ secrets.SLACK_WEBHOOK }} |
| 140 | + webhook-type: webhook-trigger |
| 141 | + payload: | |
| 142 | + { |
| 143 | + "text": "🚨 Indexer Failure Alert", |
| 144 | + "blocks": [ |
| 145 | + { |
| 146 | + "type": "section", |
| 147 | + "text": { |
| 148 | + "type": "mrkdwn", |
| 149 | + "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 }}" |
| 150 | + } |
| 151 | + } |
| 152 | + ] |
| 153 | + } |
0 commit comments