diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d7a9937..6ccfdfc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,3 +27,36 @@ jobs: outputs: python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} + + test: + name: Test on Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} + runs-on: ${{ matrix.os }} + needs: build + + strategy: + fail-fast: false + matrix: + python-version: ${{ fromJson(needs.build-package.outputs.supported-python-versions) }} + os: + - ubuntu-latest + - macos-latest + + steps: + - name: Download built package + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + - run: tar xf dist/*.tar.gz --strip-components=1 + - uses: actions/setup-python@v5 + with: + python-version: | + ${{ matrix.python-version }} + 3.x + allow-prereleases: true + + - uses: astral-sh/setup-uv@v2 + - run: uv pip install --system tox-uv + + - name: Test + run: python -Im tox run --installpkg dist/*.whl -f py$(echo ${{ matrix.python-version }} | tr -d .) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 89bd394..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Test - -on: - push: - branches: - - main - pull_request: - branches: - - main - -concurrency: - group: test-${{ github.head_ref }} - cancel-in-progress: true - -env: - PYTHONUNBUFFERED: "1" - FORCE_COLOR: "1" - -jobs: - test: - name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - python-version: - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" - os: - - "ubuntu-latest" - - "macos-latest" - # - "windows-latest" - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - - name: Get pip cache dir - id: pip-cache - run: | - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - - name: pip cache - uses: actions/cache@v3 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install tox - run: pip install --upgrade tox - - - name: Test - run: python -Im tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: ./coverage.xml - name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}