Skip to content

Add continuous integration to Github workflow #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, reopened, synchronize]
types: [opened, reopened, edited, synchronize]

jobs:
build:
Expand Down Expand Up @@ -36,4 +36,23 @@ jobs:
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
fail_ci_if_error: true

continuous-integration:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Python Poetry Action
uses: abatilo/[email protected]

- name: Run integration tests
run: |
cd integration-test && ./run_tests.sh
2 changes: 2 additions & 0 deletions integration-test/run_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

if [ "$NETWORK" = "local-alonzo" ]
then
chmod 400 /code/tmp_configs/"$NETWORK"/shelley/*.skey
chmod 400 /code/tmp_configs/"$NETWORK"/shelley/*.vkey
cardano-node run \
--config /code/tmp_configs/"$NETWORK"/config.json \
--topology /code/tmp_configs/"$NETWORK"/topology.json \
Expand Down
11 changes: 10 additions & 1 deletion integration-test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
#!/bin/sh
#!/bin/bash

set -e
set -o pipefail

ROOT=$(pwd)

poetry install

# Run alonzo integration tests
./bootstrap.sh local-alonzo

# Cleanup containers and volumes in case there is any running
docker-compose down --volume

# Launch containers
docker-compose up -d

export PAYMENT_KEY="$ROOT"/configs/local-alonzo/shelley/utxo-keys/utxo1.skey
poetry run pytest -s "$ROOT"/test

# Cleanup
docker-compose down --volume
2 changes: 1 addition & 1 deletion integration-test/test/test_mint_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestMintNFT:

chain_context = OgmiosChainContext(OGMIOS_WS, Network.TESTNET)

@retry(tries=5, delay=2)
@retry(tries=10, delay=6)
def check_ogmios(self):
print(f"Current chain tip: {self.chain_context.last_block_slot}")

Expand Down