Skip to content

github action updates: bump actions/github-script from 6 to 8 #365

github action updates: bump actions/github-script from 6 to 8

github action updates: bump actions/github-script from 6 to 8 #365

Workflow file for this run

name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: write
contents: read
checks: write
id-token: write
pull-requests: write
on:
push:
paths:
- '.github/workflows/ci.yml'
- '**'
pull_request:
paths:
- '.github/workflows/ci.yml'
- '**'
jobs:
setup:
if: github.event_name != 'release'
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.matrix.outputs.dirs }}
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Get the list of Python Directories
id: matrix
run: |
set -euo pipefail
dirs=$(find -mindepth 2 -maxdepth 2 -type f -name 'pyproject.toml' -printf '%h\n' | cut -d/ -f2- | sort | tr "\n" " " | awk '{$1=$1};1')
dirs=$(jq -n --indent 0 --arg dirs "$dirs" '$dirs | split(" ")')
echo "dirs=$dirs" >> $GITHUB_OUTPUT
- run: |
echo "dirs=${{ steps.matrix.outputs.dirs }}"
test:
if: github.event_name != 'release'
needs: [ setup ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dirs: ${{ fromJSON(needs.setup.outputs.dirs) }}
python-version: ['3.14']
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Python
id: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
id: setup-uv
uses: astral-sh/setup-uv@v7
with:
version: latest
python-version: ${{ matrix.python-version }}
cache-suffix: ${{ matrix.python-version }}
- name: Setup Test Results
run: |
mkdir -p ${{ github.workspace }}/build/coverage
mkdir -p ${{ github.workspace }}/build/test-results
- name: Run tests and collect coverage
run: |
set -euox pipefail
PACKAGE=$(echo "$(basename $PWD)" | tr "-" "_")
[ -d "${PACKAGE}" ] || PACKAGE="."
uv run --frozen pytest --cov-report=xml:${{ github.workspace }}/build/coverage/${{ matrix.dirs }}.xml --cov="${PACKAGE}" --junitxml=${{ github.workspace }}/build/test-results/${{ matrix.dirs }}.xml
working-directory: ${{ matrix.dirs }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/*.xml'
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: build/coverage/${{ matrix.dirs }}.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md