|
| 1 | +name: Test Redistribute |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + types: |
| 9 | + - opened |
| 10 | + - synchronize |
| 11 | + |
| 12 | +env: |
| 13 | + UV_SYSTEM_PYTHON: 1 |
| 14 | + |
| 15 | +jobs: |
| 16 | + test-redistribute: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Dump GitHub context |
| 20 | + env: |
| 21 | + GITHUB_CONTEXT: ${{ toJson(github) }} |
| 22 | + run: echo "$GITHUB_CONTEXT" |
| 23 | + - uses: actions/checkout@v5 |
| 24 | + - name: Set up Python |
| 25 | + uses: actions/setup-python@v6 |
| 26 | + with: |
| 27 | + python-version: "3.10" |
| 28 | + - name: Setup uv |
| 29 | + uses: astral-sh/setup-uv@v6 |
| 30 | + with: |
| 31 | + version: "0.4.15" |
| 32 | + enable-cache: true |
| 33 | + cache-dependency-glob: | |
| 34 | + pyproject.toml |
| 35 | + uv.lock |
| 36 | + - name: Install build dependencies |
| 37 | + run: uv pip install build |
| 38 | + - name: Build source distribution |
| 39 | + run: python -m build --sdist |
| 40 | + - name: Decompress source distribution |
| 41 | + run: | |
| 42 | + cd dist |
| 43 | + tar xvf annotated-doc*.tar.gz |
| 44 | + - name: Install test dependencies |
| 45 | + run: | |
| 46 | + cd dist/annotated-doc*/ |
| 47 | + uv sync |
| 48 | + - name: Run source distribution tests |
| 49 | + run: | |
| 50 | + cd dist/annotated-doc*/ |
| 51 | + bash scripts/test.sh |
| 52 | + - name: Build wheel distribution |
| 53 | + run: | |
| 54 | + cd dist |
| 55 | + uv pip wheel --no-deps annotated-doc*.tar.gz |
| 56 | + - name: Dump GitHub context |
| 57 | + env: |
| 58 | + GITHUB_CONTEXT: ${{ toJson(github) }} |
| 59 | + run: echo "$GITHUB_CONTEXT" |
| 60 | + |
| 61 | + # https://github.com/marketplace/actions/alls-green#why |
| 62 | + test-redistribute-alls-green: # This job does nothing and is only used for the branch protection |
| 63 | + if: always() |
| 64 | + needs: |
| 65 | + - test-redistribute |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - name: Decide whether the needed jobs succeeded or failed |
| 69 | + uses: re-actors/alls-green@release/v1 |
| 70 | + with: |
| 71 | + jobs: ${{ toJSON(needs) }} |
0 commit comments