Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2.1

jobs:
quality-gate:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Install uv
command: |
export UV_UNMANAGED_INSTALL=1
export UV_NO_MODIFY_PATH=1
curl -LsSf -o /tmp/uv-install.sh https://astral.sh/uv/0.11.3/install.sh
sh /tmp/uv-install.sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
- run:
name: Install project dependencies
command: |
source "$BASH_ENV"
uv sync --locked --extra dev
- run:
name: Run warnings-as-errors tests
command: |
source "$BASH_ENV"
PYTHONWARNINGS=error uv run pytest
- run:
name: Run coverage quality gate
command: |
source "$BASH_ENV"
uv run pytest --cov=src/newsdom_api --cov-branch --cov-report=term-missing --cov-fail-under=100

workflows:
quality-gate:
jobs:
- quality-gate
8 changes: 8 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: ko

reviews:
profile: chill
request_changes_workflow: true
auto_review:
enabled: true
auto_incremental_review: true
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
target-branch: develop
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"

- package-ecosystem: "pip"
directory: "/"
target-branch: develop
schedule:
interval: weekly
groups:
python:
patterns:
- "*"
11 changes: 6 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '43 5 * * 1'

Expand All @@ -17,17 +16,19 @@ jobs:
analyze:
name: codeql (python)
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@5c8a8a642e79153f5d047b10ec1cba1d1cc65699
with:
languages: python

- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@5c8a8a642e79153f5d047b10ec1cba1d1cc65699

- name: Analyze
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@5c8a8a642e79153f5d047b10ec1cba1d1cc65699
7 changes: 4 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: dependency-review

on:
pull_request:
branches: [main, develop]

permissions:
contents: read
Expand All @@ -12,9 +11,11 @@ jobs:
dependency-review:
name: dependency-review
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Dependency review
uses: actions/dependency-review-action@v4
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48
72 changes: 72 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Deploy Web Manual to GitHub Pages

on:
push:
branches:
- main
- master
- develop
paths:
- 'manual/**'
- 'mkdocs.yml'
- '.github/workflows/gh-pages.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: github-pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.10'

- name: Set up uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e
with:
version: '0.9.29'
enable-cache: true

- name: Install locked docs dependencies
run: uv sync --frozen --extra docs

- name: Build documentation site
run: uv run mkdocs build --strict

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
path: site

deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
37 changes: 37 additions & 0 deletions .github/workflows/quality-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: quality-gate

on:
push:
branches: [main, develop]
pull_request:

permissions:
contents: read

jobs:
quality-gate:
name: quality-gate
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.10'

- name: Setup uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e
with:
version: '0.11.3'

- name: Install package
run: uv sync --locked --extra dev

- name: Run quality gate
env:
PYTHONWARNINGS: error
run: uv run pytest --cov=src/newsdom_api --cov-branch --cov-report=term-missing --cov-fail-under=100
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: release

on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
attestations: write
id-token: write

jobs:
release:
name: release
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.10'

- name: Setup uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e
with:
version: '0.11.3'

- name: Build artifacts
run: uv build

- name: Generate checksums and manifest
run: |
sha256sum dist/* > dist/SHA256SUMS.txt
python scripts/release/build_release_manifest.py dist dist/release-manifest.json

- name: Upload release artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: release-artifacts
path: dist/*

- name: Attest build provenance
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be
with:
subject-path: 'dist/*'

- name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/')
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
gh release upload "${GITHUB_REF_NAME}" dist/* --clobber
else
gh release create "${GITHUB_REF_NAME}" dist/* --generate-notes
fi
13 changes: 8 additions & 5 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: scorecards

on:
push:
branches: [main, develop]
branches: [develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '31 5 * * 1'

Expand All @@ -21,19 +20,23 @@ jobs:
actions: read
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
with:
persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@v2.4.0
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46
with:
results_file: results.sarif
results_format: sarif
publish_results: ${{ github.event_name != 'pull_request' }}

- name: Upload SARIF results
if: github.event_name != 'pull_request'
uses: github/codeql-action/upload-sarif@v3
uses: github/codeql-action/upload-sarif@5c8a8a642e79153f5d047b10ec1cba1d1cc65699
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
with:
sarif_file: results.sarif
16 changes: 9 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@ on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

permissions:
contents: read

jobs:
pytest:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.10'

- name: Setup uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e

- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
run: uv sync --locked --extra dev

- name: Run tests with warnings as errors
env:
PYTHONWARNINGS: error
run: pytest
run: uv run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.egg-info/
.pytest_cache/
.coverage
.venv/
dist/
build/
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- MinerU-backed DOM parsing API for scanned Japanese newspaper PDFs
- Synthetic newspaper fixture generation and structural equivalence checks
- Protected-branch CI, security gates, release provenance workflow, and Git Flow documentation
Loading
Loading