Bump the github-action-updates group with 3 updates #2070
Workflow file for this run
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: build | |
on: | |
push: | |
release: | |
types: [created, published] | |
env: | |
python-version: '3.12' | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Set up Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Lint with pre-commit | |
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
- name: Check REUSE compliance | |
run: pip install reuse && python -m reuse lint | |
- name: Check Poetry lock file integrity | |
run: | | |
python${{ env.python-version }} -m pip install --constraint=.github/constraints.txt poetry | |
poetry config virtualenvs.in-project true | |
poetry check | |
build: | |
needs: lint | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
name: build python ${{ matrix.python-version }} | |
outputs: | |
targz: gaphas-${{ steps.meta.outputs.version }}.tar.gz | |
wheel: gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- name: Use Python Dependency Cache | |
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install Ubuntu Dependencies | |
run: | | |
sudo apt update -qq | |
sudo apt install -qq --no-install-recommends gir1.2-gtk-4.0 libgirepository1.0-dev | |
- name: Install Poetry | |
run: | | |
python${{ matrix.python-version }} -m pip install --constraint=.github/constraints.txt poetry | |
poetry config virtualenvs.in-project true | |
- name: Collect Project Data | |
id: meta | |
run: .github/scripts/metadata.sh | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: Test | |
run: xvfb-run poetry run pytest --cov=gaphas | |
- name: Code Climate Coverage Action | |
uses: paambaati/codeclimate-action@f429536ee076d758a24705203199548125a28ca7 # v9.0.0 | |
env: | |
CC_TEST_REPORTER_ID: 195e9f83022747c8eefa3ec9510dd730081ef111acd99c98ea0efed7f632ff8a | |
with: | |
coverageCommand: poetry run coverage xml | |
- name: Create Source Dist and Wheel | |
if: ${{ matrix.python-version == env.python-version }} | |
run: poetry build | |
- name: Upload gaphas-${{ steps.meta.outputs.version }}.tar.gz | |
if: ${{ matrix.python-version == env.python-version }} | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: gaphas-${{ steps.meta.outputs.version }}.tar.gz | |
path: dist/gaphas-${{ steps.meta.outputs.version }}.tar.gz | |
- name: Upload gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl | |
if: ${{ matrix.python-version == env.python-version }} | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl | |
path: dist/gaphas-${{ steps.meta.outputs.version }}-py3-none-any.whl | |
publish-to-pypi: | |
name: Publish to PyPI (release only) | |
needs: build | |
runs-on: ubuntu-22.04 | |
permissions: | |
id-token: write | |
if: ${{ github.event_name == 'release' }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: ${{ needs.build.outputs.targz }} | |
path: dist | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: ${{ needs.build.outputs.wheel }} | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # release/v1 |