Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ commands:
command: make test
no_output_timeout: 15m
- run: make test-generate
- run: make fakepackage

run_indexer_vs_algod:
steps:
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: CI - Nightly Test Suite

on:
schedule:
- cron: "37 3 * * *" # Run at 3:37 AM UTC daily
workflow_dispatch:

env:
GO_VERSION: "1.23.3"
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@v4
with:
go-version: ${{ env.GO_VERSION }}
- 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: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0
- 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/slack-github-action@v2.1.0
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@v4
with:
go-version: ${{ env.GO_VERSION }}
- 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/slack-github-action@v2.1.0
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 }}"
}
}
]
}
86 changes: 86 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI - Test Suite

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
GO_VERSION: "1.23.3"
# A stable environment for PRs.
# Set CHANNEL to nightly and update CI_E2E_FILENAME when adding a new feature.
# Change back to stable once the new feature is released.
CI_E2E_FILENAME: "rel-nightly"
CHANNEL: nightly

jobs:
test:
runs-on: ubuntu-24.04

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@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update
sudo NEEDRESTART_MODE=a apt-get -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/
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0
- 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
run: |
make e2e
make e2e-filter-test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ test-generate:
indexer-v-algod:
pytest -sv misc/parity

.PHONY: all test e2e integration fmt lint deploy sign test-package package fakepackage cmd/algorand-indexer/algorand-indexer idb/mocks/IndexerDb.go indexer-v-algod
.PHONY: all test e2e integration fmt lint deploy sign test-package package cmd/algorand-indexer/algorand-indexer idb/mocks/IndexerDb.go indexer-v-algod
Loading