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"
|
|
|
|
run: docker compose -f test/compose-db.yml up --wait
|
|
|
|
- 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"
|
|
|
|
env:
|
|
|
|
LACONIC_SO: laconic-so
|
|
|
|
run: ./scripts/integration-setup.sh
|
|
|
|
- name: "Build and run server"
|
|
|
|
env:
|
|
|
|
ETH_FORWARD_ETH_CALLS: false
|
|
|
|
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
|
|
|
|
- name: "Run tests"
|
|
|
|
env:
|
|
|
|
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:
|
|
|
|
LACONIC_SO: laconic-so
|
|
|
|
CERC_RUN_STATEDIFF: false
|
|
|
|
run: ./scripts/integration-setup.sh
|
|
|
|
- name: "Build and run server"
|
|
|
|
env:
|
|
|
|
ETH_FORWARD_ETH_CALLS: true
|
|
|
|
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
|
|
|
|
- name: "Run tests"
|
|
|
|
env:
|
|
|
|
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
|