plugeth-statediff/.gitea/workflows/test.yml

75 lines
2.1 KiB
YAML
Raw Normal View History

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 11:30:20 +00:00
run: 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
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: |
2023-07-06 11:17:53 +00:00
set -ex
2023-07-06 08:56:57 +00:00
mkdir -p _dev/.ssh
2023-07-06 11:17:53 +00:00
[[ -n "${{ secrets.CI_SSH_PRIVATE_KEY }}" ]]
2023-07-06 08:56:57 +00:00
echo "${{ secrets.CI_SSH_PRIVATE_KEY }}" > _dev/.ssh/id_rsa
2023-07-06 10:29:05 +00:00
chmod 0600 _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 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