2023-07-05 10:15:05 +00:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
2023-07-05 10:21:06 +00:00
|
|
|
pull_request:
|
|
|
|
branches: '*'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- ci-test
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit-tests:
|
|
|
|
name: "Run unit tests"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-07-05 17:19:58 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2023-07-05 10:15:05 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
check-latest: true
|
|
|
|
- name: "Run DB container"
|
2023-07-06 13:02:39 +00:00
|
|
|
run: docker compose -f test/compose.yml up --wait
|
2023-07-06 10:32:36 +00:00
|
|
|
- name: "Run tests"
|
|
|
|
run: go test -v ./...
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
integration-tests:
|
|
|
|
name: "Run integration tests"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2023-07-06 09:29:24 +00:00
|
|
|
path: ./plugeth-statediff
|
2023-07-05 10:15:05 +00:00
|
|
|
# TODO: replace with release
|
2023-07-06 08:56:57 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: cerc-io/plugeth
|
2023-07-10 22:40:12 +00:00
|
|
|
ref: telackey/49c
|
2023-07-06 09:29:24 +00:00
|
|
|
path: ./plugeth
|
2023-07-06 17:57:46 +00:00
|
|
|
# These images need access tokens configured
|
|
|
|
- name: "Build docker image"
|
|
|
|
env:
|
2023-07-10 22:40:12 +00:00
|
|
|
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
2023-07-06 08:56:57 +00:00
|
|
|
run: |
|
2023-07-07 05:30:58 +00:00
|
|
|
docker build ./plugeth-statediff -t cerc/plugeth-statediff:local \
|
|
|
|
--build-arg GIT_VDBTO_TOKEN="$TOKEN"
|
|
|
|
docker build ./plugeth -t cerc/plugeth:local \
|
|
|
|
--build-arg GIT_VDBTO_TOKEN="$TOKEN"
|
2023-07-06 09:29:24 +00:00
|
|
|
|
|
|
|
- name: "Install stack-orchestrator"
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: roysc/stack-orchestrator
|
|
|
|
ref: plugeth-testing
|
|
|
|
path: ./stack-orchestrator
|
2023-07-06 09:33:33 +00:00
|
|
|
- run: |
|
2023-07-06 09:49:17 +00:00
|
|
|
lsb_release -a
|
|
|
|
apt-get update && apt-get install -y python3-pip
|
2023-07-06 09:33:33 +00:00
|
|
|
pip install ./stack-orchestrator
|
2023-07-05 10:15:05 +00:00
|
|
|
- name: "Run testnet stack"
|
2023-07-06 09:29:24 +00:00
|
|
|
working-directory: ./plugeth-statediff
|
2023-07-05 10:15:05 +00:00
|
|
|
run: ./scripts/integration-setup.sh
|
|
|
|
- name: "Clone system-tests"
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: cerc-io/system-tests
|
|
|
|
ref: roy/dev
|
|
|
|
path: ./system-tests
|
|
|
|
- name: "Run tests"
|
|
|
|
run: |
|
|
|
|
pytest -v \
|
2023-07-06 09:56:45 +00:00
|
|
|
--accounts-url="$GETH_BOOTNODE_URL/accounts.csv" \
|
|
|
|
-k test_basic_db
|