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-04-17 09:16:02 +00:00
|
|
|
SO_VERSION: v1.1.0-87fffca-202404110321
|
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-04-18 13:54:42 +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
|
|
|
|
- name: Install Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
2024-04-18 13:54:42 +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
|
2023-09-21 06:55:26 +00:00
|
|
|
|
|
|
|
- name: Run testnet stack
|
|
|
|
env:
|
|
|
|
CERC_GO_AUTH_TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
2023-04-14 06:26:46 +00:00
|
|
|
run: ./scripts/integration-setup.sh
|
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
|
|
|
|
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
|
2023-04-14 06:26:46 +00:00
|
|
|
run: ./scripts/integration-setup.sh
|
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
|