Feat/sixty forty reward split #1962
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: e2e | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
name: Setup GO Env | |
with: | |
go-version: '1.20' | |
- name: Cache Go E2E Test modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-e2e-test-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-e2e-test- | |
- name: Export bridge configuration | |
shell: bash | |
run: | | |
echo "${{ secrets.E2E_BRIDGE_CONFIG }}" > ./examples/three-validators/bridge.yml | |
- name: Export alice application config | |
shell: bash | |
run: | | |
echo "${{ secrets.E2E_ALICE_CONFIG }}" > ./examples/three-validators/alice/config/node.yml | |
- name: Export bob application config | |
shell: bash | |
run: | | |
echo "${{ secrets.E2E_BOB_CONFIG }}" > ./examples/three-validators/bob/config/node.yml | |
- name: Export carol application config | |
shell: bash | |
run: | | |
echo "${{ secrets.E2E_CAROL_CONFIG }}" > ./examples/three-validators/carol/config/node.yml | |
- name: Export dave application configuration | |
shell: bash | |
run: | | |
echo "${{ secrets.E2E_DAVE_CONFIG }}" > ./examples/three-validators/dave/config/node.yml | |
- name: Build the stack | |
run: cd examples/three-validators; docker-compose up -d | |
- name: Perform health check on nodes | |
shell: bash | |
run: > | |
start=`date +%s` ; | |
ports=("6200" "7200" "8200" "9200") ; | |
for port in "${ports[@]}" ; do | |
MAX_TIMEOUT=60; | |
while [[ "$(curl -s 127.0.0.1:"$port"/api/v1/health)" != "{\"status\":\"OK\"}" ]]; do | |
sleep 5; ((MAX_TIMEOUT-=5)); | |
if [ "$MAX_TIMEOUT" -eq "0" ]; then break; fi ; | |
done ; | |
if [ "$MAX_TIMEOUT" -eq "0" ]; then echo "Unconfirmed health check for 127.0.0.1:$port" ; | |
else echo "Confirmed health check for 127.0.0.1:$port"; fi ; | |
done ; | |
end=`date +%s` ; | |
echo "Total: $((end-start)) seconds" | |
- name: Create e2e run test config | |
shell: bash | |
run: | | |
echo "${{ secrets.E2E_TEST_CONFIG }}" > ./e2e/setup/application.yml | |
echo "${{ secrets.E2E_BRIDGE_CONFIG }}" > ./e2e/setup/bridge.yml | |
- name: Run E2E Tests | |
run: go test ./e2e/ -timeout 3000s # 50 minutes | |
- name: Prepare container logs | |
if: ${{ always() }} | |
run: | | |
cd examples/three-validators/ && mkdir logs && | |
touch ./logs/alice.log && docker-compose logs alice > ./logs/alice.log && | |
touch ./logs/bob.log && docker-compose logs bob > ./logs/bob.log && | |
touch ./logs/carol.log && docker-compose logs carol > ./logs/carol.log && | |
touch ./logs/dave.log && docker-compose logs dave_read_only > ./logs/dave.log | |
- name: Upload Logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: validator-logs | |
path: ./examples/three-validators/logs |