Skip to content

Commit b4aaaa9

Browse files
committed
Add continuous integration to Github workflow
1 parent 7036888 commit b4aaaa9

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: ["main"]
66
pull_request:
77
branches: ["main"]
8-
types: [opened, reopened, synchronize]
8+
types: [opened, reopened, edited, synchronize]
99

1010
jobs:
1111
build:
@@ -35,5 +35,27 @@ jobs:
3535
poetry run pytest --doctest-modules --ignore=examples --cov=pycardano --cov-config=.coveragerc --cov-report=xml
3636
- name: "Upload coverage to Codecov"
3737
uses: codecov/codecov-action@v2
38+
with:
39+
fail_ci_if_error: true
40+
41+
continuous-integration:
42+
needs: build
43+
runs-on: ${{ matrix.os }}
44+
strategy:
45+
matrix:
46+
os: [ ubuntu-latest]
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Set up Python ${{ matrix.python-version }}
51+
uses: actions/setup-python@v2
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
- name: Python Poetry Action
55+
uses: abatilo/actions-poetry@v2.1.3
56+
57+
- name: Run integration tests
58+
run: |
59+
cd integration-test && ./run_tests.sh
3860
with:
3961
fail_ci_if_error: true

integration-test/run_tests.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
set -e
4+
set -o pipefail
25

36
ROOT=$(pwd)
47

58
poetry install
69

710
# Run alonzo integration tests
811
./bootstrap.sh local-alonzo
12+
13+
# Cleanup containers and volumes in case there is any running
14+
docker-compose down --volume
15+
16+
# Launch containers
917
docker-compose up -d
18+
docker-compose logs ogmios
1019

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

23+
# Cleanup
24+
docker-compose logs ogmios
1425
docker-compose down --volume

integration-test/test/test_mint_nft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TestMintNFT:
1919

2020
chain_context = OgmiosChainContext(OGMIOS_WS, Network.TESTNET)
2121

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

0 commit comments

Comments
 (0)