ipld-eth-server/.github/workflows/tests.yaml

124 lines
4.0 KiB
YAML
Raw Normal View History

name: Test the stack.
on:
workflow_call:
# 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:
SO_VERSION: v1.1.0-36d4969-202407091537
FIXTURENET_ETH_STACKS_REF: main
SYSTEM_TESTS_REF: main
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
2023-03-31 14:48:41 +00:00
with:
go-version-file: 'go.mod'
check-latest: true
- name: Run DB container
2023-05-26 10:10:16 +00:00
run: docker compose -f test/compose-db.yml up --wait --quiet-pull
- name: Build and run tests
run: |
go install github.com/onsi/ginkgo/v2/ginkgo
ginkgo -v -r --skip-package=./integration
integration-test:
name: Run integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- 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
# 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') }}
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install stack-orchestrator
uses: actions/checkout@v3
with:
repository: cerc-io/stack-orchestrator
ref: ${{ env.SO_VERSION }}
path: ./stack-orchestrator
- run: pip install ./stack-orchestrator
- 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
- name: Run testnet stack
env:
CERC_GO_AUTH_TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
run: ./scripts/run-test-stack.sh ./fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
- name: Run server
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
- name: Run tests
run: |
sleep 30
go install github.com/onsi/ginkgo/v2/ginkgo
2023-05-26 06:12:01 +00:00
ginkgo -v --label-filter '!proxy' -r ./integration
- 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
pytest -vv
- name: Run testnet stack without statediff
env:
CERC_RUN_STATEDIFF: false
SKIP_BUILD: 1
run: ./scripts/run-test-stack.sh ./fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
- name: Run server with call forwarding
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
- name: Run eth_call proxy tests
run: |
sleep 30
go install github.com/onsi/ginkgo/v2/ginkgo
2023-05-26 06:12:01 +00:00
ginkgo -v --label-filter 'proxy' -r ./integration