2022-06-02 11:59:44 +00:00
|
|
|
name: Test the stack.
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2023-04-14 06:26:46 +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
|
|
|
|
- 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-04-14 06:26:46 +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
|
2023-05-26 06:12:01 +00:00
|
|
|
ginkgo -v -r --skipPackage=./integration
|
2022-06-02 11:59:44 +00:00
|
|
|
|
2023-04-14 06:26:46 +00:00
|
|
|
integration-test:
|
|
|
|
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
|
|
|
|
- name: "Install stack-orchestrator"
|
|
|
|
# FIXME: using my dev branch for v5 migration changes until a release has them
|
|
|
|
# run: |
|
|
|
|
# curl -L -O https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so
|
|
|
|
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
|
|
|
|
ref: roy/for-ci
|
|
|
|
path: ./stack-orchestrator
|
|
|
|
- run: pip install ./stack-orchestrator
|
|
|
|
- name: "Run testnet stack"
|
|
|
|
run: ./scripts/integration-setup.sh
|
|
|
|
- name: "Build and run server"
|
|
|
|
env:
|
|
|
|
ETH_FORWARD_ETH_CALLS: false
|
2023-05-26 10:10:16 +00:00
|
|
|
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }}
|
|
|
|
ETH_CHAIN_CONFIG: ${{ env.ETH_CHAIN_CONFIG }}
|
|
|
|
DEPLOYER_PRIVATE_KEY: ${{ env.DEPLOYER_PRIVATE_KEY }}
|
|
|
|
run: docker compose -f test/compose-server.yml up --wait --quiet-pull
|
2023-04-14 06:26:46 +00:00
|
|
|
- name: "Run tests"
|
|
|
|
env:
|
2023-05-26 10:10:16 +00:00
|
|
|
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }}
|
|
|
|
ETH_HTTP_PATH: ${{ env.ETH_HTTP_PATH }}
|
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
|
2023-05-26 06:12:01 +00:00
|
|
|
ginkgo -v --label-filter '!proxy' -r ./integration
|
2022-06-02 11:59:44 +00:00
|
|
|
|
2023-04-14 06:26:46 +00:00
|
|
|
integration-test-eth-proxy:
|
|
|
|
name: "Run direct-proxy 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
|
|
|
|
- name: "Install stack-orchestrator"
|
|
|
|
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
|
|
|
|
ref: roy/for-ci
|
|
|
|
path: ./stack-orchestrator
|
|
|
|
- run: pip install ./stack-orchestrator
|
|
|
|
- name: "Run testnet stack"
|
|
|
|
env:
|
|
|
|
CERC_RUN_STATEDIFF: false
|
|
|
|
run: ./scripts/integration-setup.sh
|
|
|
|
- name: "Build and run server"
|
|
|
|
env:
|
|
|
|
ETH_FORWARD_ETH_CALLS: true
|
2023-05-26 10:10:16 +00:00
|
|
|
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }}
|
|
|
|
ETH_CHAIN_CONFIG: ${{ env.ETH_CHAIN_CONFIG }}
|
|
|
|
DEPLOYER_PRIVATE_KEY: ${{ env.DEPLOYER_PRIVATE_KEY }}
|
|
|
|
run: docker compose -f test/compose-server.yml up --wait --quiet-pull
|
2023-04-14 06:26:46 +00:00
|
|
|
- name: "Run tests"
|
|
|
|
env:
|
2023-05-26 10:10:16 +00:00
|
|
|
ETH_CHAIN_ID: ${{ env.ETH_CHAIN_ID }}
|
|
|
|
ETH_HTTP_PATH: ${{ env.ETH_HTTP_PATH }}
|
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
|
2023-05-26 06:12:01 +00:00
|
|
|
ginkgo -v --label-filter 'proxy' -r ./integration
|