2023-07-05 10:15:05 +00:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: '*'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- ci-test
|
|
|
|
|
|
|
|
# Needed until we can incorporate docker startup into the executor container
|
|
|
|
env:
|
|
|
|
DOCKER_HOST: unix:///var/run/dind.sock
|
2023-09-20 03:22:15 +00:00
|
|
|
SO_VERSION: v1.1.0-c30c779-202309082138
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit-tests:
|
2023-09-20 03:22:15 +00:00
|
|
|
name: Run unit tests
|
2023-07-05 10:15:05 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-20 03:22:15 +00:00
|
|
|
- uses: actions/setup-go@v4
|
2023-07-05 10:15:05 +00:00
|
|
|
with:
|
|
|
|
go-version-file: 'go.mod'
|
|
|
|
check-latest: true
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Run dockerd
|
2023-07-05 10:15:05 +00:00
|
|
|
run: |
|
|
|
|
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
|
|
|
sleep 5
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Run DB container
|
2023-07-05 10:15:05 +00:00
|
|
|
run: |
|
|
|
|
docker compose -f test/compose.yml up --wait
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Set up Gitea access token
|
2023-07-05 10:15:05 +00:00
|
|
|
env:
|
|
|
|
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
run: |
|
|
|
|
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf https://git.vdb.to/
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: go test -p 1 -v ./...
|
2023-07-05 10:15:05 +00:00
|
|
|
|
|
|
|
integration-tests:
|
2023-09-20 03:22:15 +00:00
|
|
|
name: Run integration tests
|
2023-07-05 10:15:05 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: ./plugeth-statediff
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: cerc-io/plugeth
|
2023-09-05 02:58:59 +00:00
|
|
|
ref: statediff
|
2023-07-05 10:15:05 +00:00
|
|
|
path: ./plugeth
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Run dockerd
|
2023-07-05 10:15:05 +00:00
|
|
|
run: dockerd -H $DOCKER_HOST --userland-proxy=false &
|
|
|
|
# These images need access tokens configured
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Build docker image
|
2023-07-05 10:15:05 +00:00
|
|
|
env:
|
|
|
|
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
run: |
|
|
|
|
[[ -n "$TOKEN" ]]
|
|
|
|
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-09-20 03:22:15 +00:00
|
|
|
- name: Install stack-orchestrator
|
|
|
|
run: |
|
|
|
|
curl -L -O https://github.com/cerc-io/stack-orchestrator/releases/download/$SO_VERSION/laconic-so
|
|
|
|
chmod +x laconic-so
|
|
|
|
- name: Clone system-tests
|
2023-07-05 10:15:05 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: cerc-io/system-tests
|
2023-09-20 03:22:15 +00:00
|
|
|
ref: plugeth-compat
|
2023-07-05 10:15:05 +00:00
|
|
|
path: ./system-tests
|
2023-09-05 02:58:59 +00:00
|
|
|
token: ${{ secrets.CICD_REPO_TOKEN }}
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Run testnet stack
|
2023-09-05 02:58:59 +00:00
|
|
|
working-directory: ./plugeth-statediff
|
2023-09-20 03:22:15 +00:00
|
|
|
env:
|
|
|
|
LACONIC_SO: ../laconic-so
|
2023-09-05 02:58:59 +00:00
|
|
|
run: ./scripts/integration-setup.sh
|
2023-09-20 03:22:15 +00:00
|
|
|
- name: Install Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3.10
|
|
|
|
- name: Run tests
|
2023-07-05 10:15:05 +00:00
|
|
|
working-directory: ./system-tests
|
|
|
|
run: |
|
|
|
|
pip install pytest
|
|
|
|
pip install -r requirements.txt
|
|
|
|
pytest -v -k test_basic_db
|
2023-09-27 01:12:19 +00:00
|
|
|
|
|
|
|
compliance-test:
|
|
|
|
name: Run compliance tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: ./plugeth-statediff
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: cerc-io/eth-statediff-compliance
|
2023-09-27 07:54:19 +00:00
|
|
|
ref: v0.1.0
|
2023-09-27 01:12:19 +00:00
|
|
|
path: ./eth-statediff-compliance
|
|
|
|
token: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
2023-09-27 01:16:54 +00:00
|
|
|
go-version-file: './eth-statediff-compliance/go.mod'
|
2023-09-27 01:12:19 +00:00
|
|
|
check-latest: true
|
2023-09-27 01:24:23 +00:00
|
|
|
- name: Install jq
|
|
|
|
run: apt-get update && apt-get install -yq jq
|
2023-09-27 01:12:19 +00:00
|
|
|
- name: Set up Gitea access token
|
|
|
|
env:
|
|
|
|
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
run: |
|
|
|
|
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf https://git.vdb.to/
|
2023-09-27 07:50:17 +00:00
|
|
|
|
2023-09-27 01:12:19 +00:00
|
|
|
- name: Update go.mod for dumpdiff-geth
|
|
|
|
working-directory: ./eth-statediff-compliance/
|
|
|
|
run: ./scripts/update-mod.sh ../plugeth-statediff dumpdiff-geth/
|
|
|
|
- name: Update go.mod for dumpdiff-plugeth
|
|
|
|
working-directory: ./eth-statediff-compliance/
|
|
|
|
run: ./scripts/update-mod.sh ../plugeth-statediff dumpdiff-plugeth/
|
|
|
|
- name: Update go.mod for dumpdiff-plugeth-parallel
|
|
|
|
working-directory: ./eth-statediff-compliance/
|
|
|
|
run: ./scripts/update-mod.sh ../plugeth-statediff dumpdiff-plugeth-parallel/
|
|
|
|
- name: Build tools
|
|
|
|
working-directory: ./eth-statediff-compliance/
|
|
|
|
run: make all
|
|
|
|
- name: Compare output of geth and plugeth
|
|
|
|
working-directory: ./eth-statediff-compliance/
|
|
|
|
run: ./scripts/compare-diffs.sh geth plugeth
|
|
|
|
- name: Compare output of geth and plugeth-parallel
|
|
|
|
working-directory: ./eth-statediff-compliance/
|
|
|
|
run: ./scripts/compare-diffs.sh geth plugeth-parallel
|