2022-06-02 11:59:44 +00:00
|
|
|
name: Test the stack.
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
2023-09-21 06:55:26 +00:00
|
|
|
# Job headers are hidden when not top-level - run them directly for readability until fixed:
|
|
|
|
# https://github.com/go-gitea/gitea/issues/26736
|
|
|
|
pull_request:
|
|
|
|
branches: '*'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- ci-test
|
|
|
|
|
|
|
|
env:
|
2024-08-05 15:50:53 +00:00
|
|
|
SO_VERSION: v1.1.0-36d4969-202407091537
|
|
|
|
FIXTURENET_ETH_STACKS_REF: main
|
2024-07-26 10:59:51 +00:00
|
|
|
SYSTEM_TESTS_REF: roysc/test-blob-tx
|
2023-09-21 06:55:26 +00:00
|
|
|
|
2022-06-02 11:59:44 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
2023-09-21 06:55:26 +00:00
|
|
|
name: Run unit tests
|
2022-06-02 11:59:44 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-14 06:26:46 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2023-03-31 14:48:41 +00:00
|
|
|
with:
|
2023-04-14 06:26:46 +00:00
|
|
|
go-version-file: 'go.mod'
|
|
|
|
check-latest: true
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Run DB container
|
2023-05-26 10:10:16 +00:00
|
|
|
run: docker compose -f test/compose-db.yml up --wait --quiet-pull
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Build and run tests
|
2022-06-02 11:59:44 +00:00
|
|
|
run: |
|
2023-04-14 06:26:46 +00:00
|
|
|
go install github.com/onsi/ginkgo/v2/ginkgo
|
2024-05-29 12:29:55 +00:00
|
|
|
ginkgo -v -r --skip-package=./integration
|
2022-06-02 11:59:44 +00:00
|
|
|
|
2023-04-14 06:26:46 +00:00
|
|
|
integration-test:
|
2023-09-21 06:55:26 +00:00
|
|
|
name: Run integration tests
|
2022-06-02 11:59:44 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-14 06:26:46 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v4
|
2022-06-02 11:59:44 +00:00
|
|
|
with:
|
2023-04-14 06:26:46 +00:00
|
|
|
go-version-file: 'go.mod'
|
|
|
|
check-latest: true
|
2023-09-21 06:55:26 +00:00
|
|
|
|
|
|
|
- name: Build server image
|
|
|
|
env:
|
|
|
|
GIT_VDBTO_TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
run: docker build . -t cerc/ipld-eth-server:local --build-arg GIT_VDBTO_TOKEN
|
|
|
|
- name: Install jq
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
run: apt-get update && apt-get install -y jq
|
2024-08-05 15:50:53 +00:00
|
|
|
# At present the stock setup-python action fails on Linux/aarch64
|
|
|
|
# Conditional steps below workaroud this by using deadsnakes for that case only
|
|
|
|
- name: "Install Python for ARM on Linux"
|
|
|
|
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
|
|
|
uses: deadsnakes/action@v3.0.1
|
|
|
|
with:
|
|
|
|
python-version: 3.11
|
|
|
|
- name: "Install Python cases other than ARM on Linux"
|
|
|
|
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
2023-09-21 06:55:26 +00:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
2024-05-29 12:29:55 +00:00
|
|
|
python-version: 3.11
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Install stack-orchestrator
|
2023-04-14 06:26:46 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-06-02 11:59:44 +00:00
|
|
|
with:
|
2023-04-14 06:26:46 +00:00
|
|
|
repository: cerc-io/stack-orchestrator
|
2023-09-21 06:55:26 +00:00
|
|
|
ref: ${{ env.SO_VERSION }}
|
2023-04-14 06:26:46 +00:00
|
|
|
path: ./stack-orchestrator
|
|
|
|
- run: pip install ./stack-orchestrator
|
2024-08-05 15:50:53 +00:00
|
|
|
- name: Clone fixturenet stack repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: cerc-io/fixturenet-eth-stacks
|
|
|
|
ref: ${{ env.FIXTURENET_ETH_STACKS_REF }}
|
|
|
|
path: ./fixturenet-eth-stacks
|
|
|
|
progress: false
|
2023-09-21 06:55:26 +00:00
|
|
|
|
|
|
|
- name: Run testnet stack
|
|
|
|
env:
|
|
|
|
CERC_GO_AUTH_TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
2024-08-05 15:50:53 +00:00
|
|
|
run: ./scripts/run-test-stack.sh ./fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Run server
|
2023-04-14 06:26:46 +00:00
|
|
|
env:
|
|
|
|
ETH_FORWARD_ETH_CALLS: false
|
2023-05-26 10:10:16 +00:00
|
|
|
run: docker compose -f test/compose-server.yml up --wait --quiet-pull
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Run tests
|
2022-06-02 11:59:44 +00:00
|
|
|
run: |
|
2023-09-21 06:55:26 +00:00
|
|
|
sleep 30
|
2023-04-14 06:26:46 +00:00
|
|
|
go install github.com/onsi/ginkgo/v2/ginkgo
|
2023-05-26 06:12:01 +00:00
|
|
|
ginkgo -v --label-filter '!proxy' -r ./integration
|
2022-06-02 11:59:44 +00:00
|
|
|
|
2024-08-05 15:50:53 +00:00
|
|
|
- name: Clone system-tests
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: cerc-io/system-tests
|
|
|
|
ref: ${{ env.SYSTEM_TESTS_REF }}
|
|
|
|
path: ./system-tests
|
|
|
|
token: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
progress: false
|
|
|
|
- name: Run system tests
|
|
|
|
working-directory: ./system-tests
|
|
|
|
run: |
|
|
|
|
pip install pytest
|
|
|
|
pip install -r requirements.txt
|
2024-07-26 10:59:51 +00:00
|
|
|
# Skips tests that require Blob indexing
|
|
|
|
pytest -vv -m "not blob_db"
|
2024-08-05 15:50:53 +00:00
|
|
|
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Run testnet stack without statediff
|
2023-04-14 06:26:46 +00:00
|
|
|
env:
|
|
|
|
CERC_RUN_STATEDIFF: false
|
2023-09-21 06:55:26 +00:00
|
|
|
SKIP_BUILD: 1
|
2024-08-05 15:50:53 +00:00
|
|
|
run: ./scripts/run-test-stack.sh ./fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Run server with call forwarding
|
2023-04-14 06:26:46 +00:00
|
|
|
env:
|
|
|
|
ETH_FORWARD_ETH_CALLS: true
|
2023-05-26 10:10:16 +00:00
|
|
|
run: docker compose -f test/compose-server.yml up --wait --quiet-pull
|
2023-09-21 06:55:26 +00:00
|
|
|
- name: Run eth_call proxy tests
|
2022-06-02 11:59:44 +00:00
|
|
|
run: |
|
2023-09-21 06:55:26 +00:00
|
|
|
sleep 30
|
2023-04-14 06:26:46 +00:00
|
|
|
go install github.com/onsi/ginkgo/v2/ginkgo
|
2023-05-26 06:12:01 +00:00
|
|
|
ginkgo -v --label-filter 'proxy' -r ./integration
|