|
| 1 | +# .github/workflows/publish_testpypi.yml |
| 2 | +--- |
| 3 | +name: test-n-build |
| 4 | +on: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - v* |
| 8 | +jobs: |
| 9 | + super-test: |
| 10 | + strategy: |
| 11 | + max-parallel: 2 |
| 12 | + matrix: |
| 13 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 14 | + python_v: ['3.8', '3.9', '3.10', ''] |
| 15 | + chrome_v: ['-1'] |
| 16 | + name: Build and Test |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - uses: astral-sh/setup-uv@v4 |
| 21 | + - name: Install Dependencies |
| 22 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 23 | + run: sudo apt-get update && sudo apt-get install xvfb |
| 24 | + timeout-minutes: 1 |
| 25 | + # must actually checkout for version determination |
| 26 | + - run: git checkout ${{ github.ref_name }} |
| 27 | + - run: uv python install ${{ matrix.python_v }} |
| 28 | + - run: uv python pin ${{ matrix.python_v }} |
| 29 | + if: ${{ matrix.python_v != '' }} |
| 30 | + # don't modify sync file! messes up version! |
| 31 | + - run: uv sync --no-sources --all-extras --frozen # does order matter? |
| 32 | + - run: uv build |
| 33 | + - name: Reinstall from wheel |
| 34 | + run: > |
| 35 | + uv pip install dist/choreographer-$(uv |
| 36 | + run --no-sync --with setuptools-git-versioning |
| 37 | + setuptools-git-versioning)-py3-none-any.whl |
| 38 | + - run: uv run --no-sync choreo_get_chrome -v --i ${{ matrix.chrome_v }} |
| 39 | + - name: Diagnose |
| 40 | + run: uv run --no-sync choreo_diagnose --no-run |
| 41 | + |
| 42 | + - name: Test mocker |
| 43 | + run: > |
| 44 | + uv run |
| 45 | + --no-sources kaleido_mocker |
| 46 | + --random 100 |
| 47 | + --logistro-level INFO |
| 48 | +
|
| 49 | + - name: Test |
| 50 | + if: ${{ ! runner.debug && matrix.os != 'ubuntu-latest' }} |
| 51 | + run: uv run --no-sync poe test |
| 52 | + timeout-minutes: 8 |
| 53 | + |
| 54 | + - name: Test (Linux) |
| 55 | + if: ${{ ! runner.debug && matrix.os == 'ubuntu-latest' }} |
| 56 | + run: xvfb-run uv run --no-sync poe test |
| 57 | + timeout-minutes: 8 |
| 58 | + |
| 59 | + - name: Test (Debug) |
| 60 | + if: runner.debug |
| 61 | + run: uv run --no-sync poe debug-test |
| 62 | + timeout-minutes: 20 |
| 63 | + |
| 64 | + - name: Test (Debug, Linux) |
| 65 | + if: ${{ runner.debug && matrix.os == 'ubuntu-latest' }} |
| 66 | + run: xvfb-run uv run --no-sync poe debug-test |
| 67 | + timeout-minutes: 8 |
| 68 | + |
| 69 | + testpypi-publish: |
| 70 | + name: Upload release to TestPyPI |
| 71 | + needs: super-test |
| 72 | + if: always() && !cancelled() && !failure() |
| 73 | + runs-on: ubuntu-latest |
| 74 | + environment: |
| 75 | + name: testpypi |
| 76 | + url: https://test.pypi.org/p/choreographer |
| 77 | + # Signs this workflow so pypi trusts it |
| 78 | + permissions: |
| 79 | + id-token: write |
| 80 | + steps: |
| 81 | + - name: Checkout |
| 82 | + uses: actions/checkout@v4 |
| 83 | + - uses: astral-sh/setup-uv@v4 |
| 84 | + - uses: actions/setup-python@v5 |
| 85 | + with: |
| 86 | + python-version-file: "pyproject.toml" |
| 87 | + - run: git checkout ${{ github.ref_name }} |
| 88 | + - run: uv sync --no-sources --frozen --all-extras |
| 89 | + - run: uv build |
| 90 | + - name: Publish package distributions to PyPI |
| 91 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 92 | + with: |
| 93 | + repository-url: https://test.pypi.org/legacy/. |
0 commit comments