Skip to content

Bump the github-action-updates group with 2 updates #1177

Bump the github-action-updates group with 2 updates

Bump the github-action-updates group with 2 updates #1177

Workflow file for this run

name: build
on:
push:
branches:
- main
paths-ignore:
- '*.md'
pull_request:
branches:
- main
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
python-version: '3.12'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
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-latest
permissions:
contents: write
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
name: build (python ${{ matrix.python-version }})
outputs:
targz: generic-${{ steps.meta.outputs.version }}.tar.gz
wheel: generic-${{ steps.meta.outputs.version }}-py3-none-any.whl
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- 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: poetry run pytest --cov=generic
- name: Code Climate Coverage Action
uses: paambaati/codeclimate-action@f429536ee076d758a24705203199548125a28ca7 # v9.0.0
env:
CC_TEST_REPORTER_ID: f9441442730130d385df69241a779ac3b663756ed21881179826e3fab7e01924
with:
coverageCommand: poetry run coverage xml
- name: Create Source Dist and Wheel
if: ${{ matrix.python-version == env.python-version }}
run: poetry build
- name: Upload generic-${{ steps.meta.outputs.version }}.tar.gz
if: ${{ matrix.python-version == env.python-version }}
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: generic-${{ steps.meta.outputs.version }}.tar.gz
path: dist/generic-${{ steps.meta.outputs.version }}.tar.gz
- name: Upload generic-${{ steps.meta.outputs.version }}-py3-none-any.whl
if: ${{ matrix.python-version == env.python-version }}
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: generic-${{ steps.meta.outputs.version }}-py3-none-any.whl
path: dist/generic-${{ 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@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Download tar.gz
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.build.outputs.targz }}
path: dist
- name: Download wheel
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.build.outputs.wheel }}
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # release/v1