Skip to content

fix: stage CHANGELOG.md in semantic-release build_command (#301) #618

fix: stage CHANGELOG.md in semantic-release build_command (#301)

fix: stage CHANGELOG.md in semantic-release build_command (#301) #618

Workflow file for this run

name: ci
"on":
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
LANG: "en_US.utf-8"
LC_ALL: "en_US.utf-8"
PYTHONIOENCODING: "UTF-8"
PYTHON_VERSIONS: ""
jobs:
changes:
runs-on: blacksmith-4vcpu-ubuntu-2404
permissions:
pull-requests: read
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: |
src:
- 'project/**'
- 'tests/**'
- 'scripts/**'
- 'copier.yml'
- 'extensions.py'
- 'pyproject.toml'
- 'uv.lock'
- 'docs/**'
- '*.md'
links:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check links
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
with:
fail: true
token: ${{ secrets.GITHUB_TOKEN }}
args: --config .lychee.toml --no-progress .
prek:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: "3.14"
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
env:
SKIP: no-commit-to-branch,pytest-cov,lychee
with:
extra-args: '--all-files'
test-project:
needs: changes
if: ${{ github.event_name == 'push' || needs.changes.outputs.src == 'true' }}
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
- name: Configure Git
run: |
git config --global init.defaultBranch main
git config --global user.email "[email protected]"
git config --global user.name "I Choose to Accept"
- name: Setup uv and Python
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: "3.14"
enable-cache: true
cache-dependency-glob: project/pyproject.toml.jinja
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Copier
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
run: uv tool install copier --with copier-template-extensions
- name: Test file names
run: bash tests/test_filenames.sh
- name: Test licenses
run: uv run --with jinja2 --with pyyaml --with reuse python tests/test_licenses.py
- name: Test project generation and workflow
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
run: uv run pytest tests/test_template.py tests/test_template_lint.py -v --cov=tests --cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
ci-pass:
if: always()
needs: [links, prek, test-project]
runs-on: ubuntu-latest
steps:
- name: Check all jobs passed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
allowed-skips: test-project
allowed-failures: links
jobs: ${{ toJSON(needs) }}