Skip to content
Merged
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
14 changes: 9 additions & 5 deletions .github/workflows/sync-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ jobs:
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements.lock

- name: Cache uv packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-py3.12-${{ hashFiles('uv.lock') }}

- name: Cache pre-commit environments
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
Expand All @@ -37,13 +41,13 @@ jobs:

- name: Install Python dependencies
run: |
python -m pip install -r requirements.lock
pip install pre-commit==4.5.1
python -m pip install uv==0.9.10
uv sync --frozen

- name: Sync upstream issues and PRs from GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python tools/sync_oss.py
run: .venv/bin/python tools/sync_oss.py

- name: Check for data changes
id: diff
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,24 @@ jobs:
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements.lock

- name: Cache uv packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-py3.12-${{ hashFiles('uv.lock') }}

- name: Cache pre-commit environments
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-py3.12-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install dependencies
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.lock
pip install pre-commit==4.5.1 ai-sec-gate==0.5.0
python -m pip install uv==0.9.10
uv sync --frozen

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
Expand All @@ -66,15 +70,15 @@ jobs:
run: printf '%s (#%s)\n' "$PR_TITLE" "$PR_NUMBER" | npm run lint:commits

- name: Public privacy checks
run: python tools/check_private.py --all-files
run: .venv/bin/python tools/check_private.py --all-files

- name: Validate, build and test
run: ./build

- name: Security posture and hook verification (ai-sec-gate L4)
run: |
git config core.hooksPath .githooks
ai-sec-gate check . --prove --with-deps-audit --min-level 4 --badge /tmp/sec-posture.json
.venv/bin/ai-sec-gate check . --prove --with-deps-audit --min-level 4 --badge /tmp/sec-posture.json

- name: Publish live security posture badge to badges branch
if: always() && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule')
Expand All @@ -98,7 +102,7 @@ jobs:
test -z "$(git ls-files --others --exclude-standard -- tools/generated '*.html')"

- name: Package validated public site
run: python tools/package_site.py
run: .venv/bin/python tools/package_site.py

- name: Upload validated Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ A static portfolio generated from public YAML documents and governed by portable

## Local setup

Requires Python 3.12+ and Node.js 22.12+. Install from the checked-in dependency versions:
Requires Python 3.12+, [uv](https://docs.astral.sh/uv/), and Node.js 22.12+. Install from the checked-in lockfiles (`uv.lock` and `package-lock.json`):

```sh
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.lock
uv sync --frozen
npm ci
pipx install pre-commit==4.5.1
```

If pre-commit is already installed, reuse it. Select the repository's checked-in hook explicitly:
`uv sync --frozen` provisions `.venv/` with all runtime dependencies plus `pre-commit` and `ai-sec-gate`. Select the repository's checked-in hook explicitly:

```sh
git config core.hooksPath .githooks
Expand Down
6 changes: 4 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ echo "10/10 search <- generated HTML pages"

echo
echo "declared checks <- .pre-commit-config.yaml"
if command -v pre-commit >/dev/null 2>&1; then
if [ -x .venv/bin/pre-commit ]; then
.venv/bin/pre-commit run --all-files
elif command -v pre-commit >/dev/null 2>&1; then
pre-commit run --all-files
else
echo " -> pre-commit is not installed. Run: pip install pre-commit" >&2
echo " -> pre-commit is not installed. Run: uv sync --frozen" >&2
exit 3
fi

Expand Down
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
[project]
name = "contract-driven-portfolio"
version = "1.0.0"
description = "Contract-driven static portfolio generated from YAML and governed by JSON Schema Draft 2020-12."
requires-python = ">=3.12,<3.15"
dependencies = [
"PyYAML==6.0.3",
"jsonschema==4.26.0",
"pydantic==2.13.5",
"Jinja2==3.1.6",
"datamodel-code-generator==0.87.0",
]

[dependency-groups]
dev = [
"pre-commit==4.5.1",
"ai-sec-gate==0.5.0",
]

[tool.uv]
package = false

[tool.datamodel-codegen]
allow-remote-refs = false
collapse-root-models = true
Expand Down
28 changes: 0 additions & 28 deletions requirements.lock

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

Loading