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
|
2023-07-11 02:43:21 +00:00
|
|
|
- name: "Set up Gitea access token"
|
2023-07-11 02:28:49 +00:00
|
|
|
env:
|
|
|
|
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
|
|
|
run: |
|
2023-07-11 03:09:35 +00:00
|
|
|
[[ -n "$TOKEN" ]]
|
2023-07-11 02:28:49 +00:00
|
|
|
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"
|
2023-07-11 08:47:56 +00:00
|
|
|
- name: "Run DB container"
|
2023-07-11 10:28:53 +00:00
|
|
|
env:
|
2023-07-12 07:50:02 +00:00
|
|
|
DATABASE_HOSTNAME: 127.0.0.1
|
2023-07-11 08:47:56 +00:00
|
|
|
run: |
|
2023-07-11 11:36:59 +00:00
|
|
|
set -x
|
2023-07-11 11:56:11 +00:00
|
|
|
docker compose -f test/compose.yml up --attach ipld-eth-db &
|
2023-07-11 14:24:46 +00:00
|
|
|
sleep 60
|
2023-07-11 11:36:59 +00:00
|
|
|
docker ps
|
2023-07-12 08:04:01 +00:00
|
|
|
apt-get update && apt-get install -y netcat
|
2023-07-12 07:50:02 +00:00
|
|
|
nc -v $DATABASE_HOSTNAME 8077
|
2023-07-11 08:47:56 +00:00
|
|
|
go test -v ./...
|
|
|
|
# - 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:54:21 +00:00
|
|
|
ref: statediff-wip
|
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-11 03:09:35 +00:00
|
|
|
[[ -n "$TOKEN" ]]
|
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
|
|
|
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
|