Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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:
- "*"
15 changes: 9 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@ on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '43 5 * * 1'

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: codeql (python)
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

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

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

- name: Analyze
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
persist-credentials: false

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

- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
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@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
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@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd

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

- name: Setup uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
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
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: release

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

permissions:
contents: read

jobs:
release:
name: release
runs-on: ubuntu-latest
permissions:
contents: write
attestations: write
id-token: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

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

- name: Setup uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
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@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: release-artifacts
path: dist/*

- name: Attest build provenance
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd
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@4eaacf0543bb3f2c246792bd56e8cdeffafb205a
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@c10b8064de6f491fea524254123dbe5e09572f13
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd

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

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

- 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
Loading
Loading