diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d557919..6d074eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,10 @@ on: # Daily at 3:11 - cron: "11 3 * * *" +env: + PIP_DISABLE_PIP_VERSION_CHECK: "1" + PIP_NO_PYTHON_VERSION_WARNING: "1" + jobs: pre-commit: runs-on: ubuntu-latest @@ -16,15 +20,34 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.x" - uses: pre-commit/action@v3.0.0 + list: + runs-on: ubuntu-latest + outputs: + noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }} + steps: + - uses: actions/checkout@v3 + - name: Set up nox + uses: wntrblm/nox@2022.11.21 + - id: noxenvs-matrix + run: | + echo >>$GITHUB_OUTPUT noxenvs=$( + nox --list-sessions | + grep '^* ' | + cut -d ' ' -f 2- | + jq --raw-input --slurp 'split("\n") | map(select(. != ""))' + ) + ci: + needs: list runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macos-latest, ubuntu-latest] + noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }} steps: - uses: actions/checkout@v3 @@ -32,18 +55,18 @@ jobs: run: > sudo apt-get update && sudo apt-get install -y libenchant-2-dev libxml2-dev libxslt-dev - if: runner.os == 'Linux' + if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs') - name: Install dependencies run: brew install enchant - if: runner.os == 'macOS' + if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs') - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.x" - name: Set up nox uses: wntrblm/nox@2022.11.21 - name: Run nox - run: nox + run: nox -s "${{ matrix.noxenv }}" packaging: needs: ci @@ -54,28 +77,20 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.x" - name: Install dependencies run: python -m pip install build - name: Create packages run: python -m build . - - name: Set up nox - uses: wntrblm/nox@2022.11.21 - - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist - name: Publish to PyPI if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ password: ${{ secrets.pypi_password }} - name: Create a Release if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') uses: softprops/action-gh-release@v1 with: files: | - shiv/bowtie dist/* generate_release_notes: true