Fix CI #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
FORCE_COLOR: "1" # Make tools pretty. | |
jobs: | |
build: | |
name: Build and verify package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
id: baipp | |
outputs: | |
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | |
test: | |
name: Test on Python ${{ matrix.python-version }} | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ${{ fromJson(needs.build.outputs.python-versions) }} | |
steps: | |
# One could test the packaged code instead. | |
# https://github.com/hynek/structlog/blob/main/.github/workflows/ci.yml | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- name: Install package | |
run: python -m pip install -e .[test] | |
- name: Test package | |
run: python -m pytest | |
publish-to-testpypi: | |
name: Publish to TestPyPI | |
needs: test | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/gsffile | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist/ | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |