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"
|
|
|
|
run: docker compose -f test/compose.yml up --wait --quiet-pull
|
|
|
|
- name: "Run tests"
|
|
|
|
run: go test -v ./...
|
|
|
|
|
|
|
|
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
|
|
|
|
ref: statediff-wip
|
2023-07-06 09:29:24 +00:00
|
|
|
path: ./plugeth
|
2023-07-06 08:56:57 +00:00
|
|
|
- name: "Install SSH for image builds"
|
2023-07-06 09:29:24 +00:00
|
|
|
working-directory: ./plugeth-statediff
|
2023-07-06 08:56:57 +00:00
|
|
|
run: |
|
|
|
|
mkdir -p _dev/.ssh
|
|
|
|
echo "${{ secrets.CI_SSH_PRIVATE_KEY }}" > _dev/.ssh/id_rsa
|
2023-07-06 09:29:24 +00:00
|
|
|
ssh-keyscan git.vdb.to >> _dev/.ssh/known_hosts
|
2023-07-06 08:56:57 +00:00
|
|
|
echo '[url "ssh://git@git.vdb.to"] insteadOf = https://git.vdb.to' > _dev/.gitconfig
|
2023-07-06 09:29:24 +00:00
|
|
|
cp -r _dev ../plugeth/
|
|
|
|
|
|
|
|
- name: "Install stack-orchestrator"
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: roysc/stack-orchestrator
|
|
|
|
ref: plugeth-testing
|
|
|
|
path: ./stack-orchestrator
|
2023-07-06 05:24:46 +00:00
|
|
|
- run: 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 \
|
|
|
|
--accounts-url="$GETH_BOOTNODE_URL/accounts.csv"
|