88 lines
2.5 KiB
YAML
88 lines
2.5 KiB
YAML
name: Test
|
|
|
|
on:
|
|
pull_request:
|
|
branches: '*'
|
|
push:
|
|
branches:
|
|
- main
|
|
- ci-test
|
|
|
|
jobs:
|
|
unit-tests:
|
|
name: "Run unit tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
check-latest: true
|
|
- name: "Set up Gitea access token"
|
|
env:
|
|
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
|
|
run: |
|
|
[[ -n "$TOKEN" ]]
|
|
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"
|
|
- name: "Run DB container"
|
|
env:
|
|
DATABASE_HOSTNAME: 127.0.0.1
|
|
run: |
|
|
set -x
|
|
docker compose -f test/compose.yml up --attach ipld-eth-db &
|
|
sleep 60
|
|
docker ps
|
|
apt-get update && apt-get install -y netcat
|
|
nc -v $DATABASE_HOSTNAME 8077
|
|
go test -v ./...
|
|
# - name: "Run tests"
|
|
# run: go test -v ./...
|
|
|
|
integration-tests:
|
|
name: "Run integration tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
path: ./plugeth-statediff
|
|
# TODO: replace with release
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: cerc-io/plugeth
|
|
ref: statediff-wip
|
|
path: ./plugeth
|
|
# These images need access tokens configured
|
|
- name: "Build docker image"
|
|
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"
|
|
|
|
- name: "Install stack-orchestrator"
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: roysc/stack-orchestrator
|
|
ref: plugeth-testing
|
|
path: ./stack-orchestrator
|
|
- run: |
|
|
apt-get update && apt-get install -y python3-pip
|
|
pip install ./stack-orchestrator
|
|
- name: "Run testnet stack"
|
|
working-directory: ./plugeth-statediff
|
|
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" \
|
|
-k test_basic_db
|