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

84 lines
2.4 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
2023-07-12 13:15:02 +00:00
- name: "Run DB container"
run: |
docker compose -f test/compose.yml up --wait
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-12 13:15:02 +00:00
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf https://git.vdb.to/
- name: "Run tests"
2023-07-11 10:28:53 +00:00
env:
2023-07-12 13:15:02 +00:00
DATABASE_HOSTNAME: gitea.local
DATABASE_PORT: 8077
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:
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:
2023-07-12 13:15:02 +00:00
repository: cerc-io/stack-orchestrator
2023-07-06 09:29:24 +00:00
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
2023-07-12 13:15:02 +00:00
ref: roy/dev
2023-07-05 10:15:05 +00:00
path: ./system-tests
- name: "Run tests"
2023-07-12 09:45:11 +00:00
working-directory: ./system-tests
2023-07-05 10:15:05 +00:00
run: |
2023-07-12 13:15:02 +00:00
pip install pytest
pip install -r requirements.txt
pytest -v --host=gitea.local --db-host=gitea.local \
-k test_basic_db