|
| 1 | +name: CI - Test Suite |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ main ] |
| 6 | + push: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + unit-test: |
| 11 | + name: Unit Tests (Python ${{ matrix.python-version }}) |
| 12 | + runs-on: ubuntu-24.04 |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + python-version: ["3.10", "3.11", "3.12"] |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v4 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + - name: Cache pip dependencies |
| 25 | + uses: actions/cache@v3 |
| 26 | + with: |
| 27 | + path: ~/.cache/pip |
| 28 | + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }} |
| 29 | + restore-keys: | |
| 30 | + ${{ runner.os }}-pip-${{ matrix.python-version }}- |
| 31 | + - name: Install dependencies |
| 32 | + run: pip install -r requirements.txt |
| 33 | + - name: Run linting |
| 34 | + run: make lint |
| 35 | + - name: Run unit tests |
| 36 | + run: make pytest-unit |
| 37 | + |
| 38 | + integration-test: |
| 39 | + name: Integration Tests (Python ${{ matrix.python-version }}) |
| 40 | + runs-on: ubuntu-24.04 |
| 41 | + strategy: |
| 42 | + matrix: |
| 43 | + python-version: ["3.10", "3.11", "3.12"] |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Checkout code |
| 47 | + uses: actions/checkout@v4 |
| 48 | + - name: Set up Python ${{ matrix.python-version }} |
| 49 | + uses: actions/setup-python@v4 |
| 50 | + with: |
| 51 | + python-version: ${{ matrix.python-version }} |
| 52 | + - name: Cache pip dependencies |
| 53 | + uses: actions/cache@v3 |
| 54 | + with: |
| 55 | + path: ~/.cache/pip |
| 56 | + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }} |
| 57 | + restore-keys: | |
| 58 | + ${{ runner.os }}-pip-${{ matrix.python-version }}- |
| 59 | + - name: Install dependencies |
| 60 | + run: pip install -r requirements.txt |
| 61 | + - name: Run integration tests |
| 62 | + run: make ci-test |
| 63 | + |
| 64 | + docset: |
| 65 | + name: Generate Documentation |
| 66 | + runs-on: ubuntu-24.04 |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Checkout code |
| 70 | + uses: actions/checkout@v4 |
| 71 | + - name: Set up Python 3.10 |
| 72 | + uses: actions/setup-python@v4 |
| 73 | + with: |
| 74 | + python-version: '3.10' |
| 75 | + - name: Cache pip dependencies |
| 76 | + uses: actions/cache@v3 |
| 77 | + with: |
| 78 | + path: ~/.cache/pip |
| 79 | + key: ${{ runner.os }}-docs-pip-3.10-${{ hashFiles('**/requirements.txt', 'docs/requirements.txt') }} |
| 80 | + restore-keys: | |
| 81 | + ${{ runner.os }}-docs-pip-3.10- |
| 82 | + |
| 83 | + - name: Install dependencies and build documentation |
| 84 | + run: | |
| 85 | + pip install -r requirements.txt |
| 86 | + cd docs |
| 87 | + pip install -r requirements.txt |
| 88 | + pip install sphinx sphinx_rtd_theme doc2dash |
| 89 | + make html |
| 90 | + doc2dash --name py-algo-sdk --index-page index.html --online-redirect-url https://py-algorand-sdk.readthedocs.io/en/latest/ _build/html |
| 91 | + tar -czvf py-algo-sdk.docset.tar.gz py-algo-sdk.docset |
| 92 | + mv py-algo-sdk.docset.tar.gz /tmp |
| 93 | + |
| 94 | + - name: Upload docset artifact |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: py-algo-sdk-docset |
| 98 | + path: /tmp/py-algo-sdk.docset.tar.gz |
0 commit comments