Skip to content

Merge pull request #81 from case/dependabot/uv/selectolax-0.4.10 #146

Merge pull request #81 from case/dependabot/uv/selectolax-0.4.10

Merge pull request #81 from case/dependabot/uv/selectolax-0.4.10 #146

Workflow file for this run

name: Tests
on:
workflow_dispatch: # Enables the web UI manual trigger
pull_request:
branches: [main]
paths:
- ".github/workflows/**"
- "pyproject.toml"
- "uv.lock"
- "data/generated/**"
- "data/manual/**"
- "src/**"
- "tests/**"
push:
branches: [main]
paths:
- ".github/workflows/**"
- "pyproject.toml"
- "uv.lock"
- "data/generated/**"
- "data/manual/**"
- "src/**"
- "tests/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# actions: read is needed to pull the iptoasn artifact across workflows.
permissions:
contents: read
actions: read
jobs:
Tests:
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
version-file: "pyproject.toml"
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Install dependencies
run: bin/setup
# iptoasn is required build data; reuse the artifact update-iptoasn
# publishes daily (45-day retention).
- name: Find latest iptoasn artifact run
id: iptoasn-run
env:
GH_TOKEN: ${{ github.token }}
run: |
run_id=$(gh run list --workflow=update-iptoasn.yaml --status=success \
--limit=1 --json databaseId -q '.[0].databaseId')
if [ -z "$run_id" ]; then
echo "::error::No successful update-iptoasn run found; cannot fetch required iptoasn data"
exit 1
fi
echo "run_id=$run_id" >> "$GITHUB_OUTPUT"
- name: Download iptoasn artifact
uses: actions/download-artifact@v8
with:
pattern: iptoasn-*
path: data/source/iptoasn
github-token: ${{ github.token }}
run-id: ${{ steps.iptoasn-run.outputs.run_id }}
merge-multiple: true
- name: Run tests
run: |
set -o pipefail
# Intentional pipe to tee; SC2266 misreads it as a mistaken ||.
# shellcheck disable=SC2266
bin/test 2>&1 | tee test-output.log
- name: Capture build logs
if: always()
run: |
{
echo "=== UV Version ==="
uv --version
printf '\n=== Python Version ===\n'
python --version
printf '\n=== System Info ===\n'
uname -a
printf '\n=== Dependency Tree ===\n'
uv tree 2>&1 || echo "Failed to generate dependency tree"
printf '\n=== Lock File Info ===\n'
ls -la uv.lock 2>&1 || echo "No uv.lock found"
} > build-info.log
- name: Upload failure artifacts
uses: actions/upload-artifact@v7
if: always()
with:
name: test-failure-logs-${{ github.run_id }}
path: |
test-output.log
build-info.log
.venv/pyvenv.cfg
retention-days: 7
- name: Notification if failure
if: ${{ failure() }}
run: |
curl -Ss -X POST -H 'Content-type: application/json' \
--data '{
"token": "${{ secrets.PUSHOVER_API_TOKEN }}",
"user": "${{ secrets.PUSHOVER_USER_KEY }}",
"title": "Test run failed",
"message": "❌ Tests failed for iana-data"
}' \
https://api.pushover.net/1/messages.json