diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ce72c81 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + unit: + name: unit + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: pip + cache-dependency-path: sdk/pyproject.toml + + - name: Install dependencies + working-directory: ./sdk + run: | + python -m pip install --upgrade pip + python -m pip install -e .[dev] + + - name: Run unit tests + working-directory: ./sdk + run: pytest tests --ignore=tests/test_integration.py + + integration: + name: integration + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + TRP_ENDPOINT: ${{ secrets.TRP_ENDPOINT }} + TEST_PARTY_A_ADDRESS: ${{ secrets.TEST_PARTY_A_ADDRESS }} + TEST_PARTY_A_MNEMONIC: ${{ secrets.TEST_PARTY_A_MNEMONIC }} + TEST_PARTY_B_ADDRESS: ${{ secrets.TEST_PARTY_B_ADDRESS }} + TEST_PARTY_B_MNEMONIC: ${{ secrets.TEST_PARTY_B_MNEMONIC }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: pip + cache-dependency-path: sdk/pyproject.toml + + - name: Install dependencies + working-directory: ./sdk + run: | + python -m pip install --upgrade pip + python -m pip install -e .[dev] + + - name: Run integration tests + working-directory: ./sdk + run: pytest tests/test_integration.py