Skip to content

Commit be632cf

Browse files
committed
initial
0 parents  commit be632cf

49 files changed

Lines changed: 11766 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dagger/pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[project]
2+
name = "ascii-daggerverse"
3+
version = "0.1.0"
4+
requires-python = ">=3.13"
5+
dependencies = ["dagger-io"]
6+
7+
[build-system]
8+
requires = ["hatchling"]
9+
build-backend = "hatchling.build"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""CI helpers for the ASCII Daggerverse repository."""
2+
3+
from ascii_daggerverse.main import AsciiDaggerverse as AsciiDaggerverse
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
from typing import Annotated
2+
3+
import dagger
4+
from dagger import DefaultPath, Doc, Ignore, check, dag, field, function, object_type
5+
6+
_SOURCE_IGNORE = [
7+
"**/__pycache__",
8+
"**/*.pyc",
9+
"**/.git",
10+
"**/.pixi",
11+
"**/.venv",
12+
"**/.pytest_cache",
13+
"**/.ruff_cache",
14+
"**/.mypy_cache",
15+
"**/.direnv",
16+
"**/.devenv",
17+
"**/node_modules",
18+
"**/dist",
19+
"**/build",
20+
"**/*.egg-info",
21+
"**/sdk",
22+
]
23+
24+
25+
def _base() -> dagger.Container:
26+
return dag.container().from_("ghcr.io/prefix-dev/pixi:0.70.2").with_workdir("/workspace")
27+
28+
29+
@object_type
30+
class AsciiDaggerverse:
31+
"""CI and docs helpers for the ASCII Daggerverse repository."""
32+
33+
source: Annotated[
34+
dagger.Directory,
35+
Doc("Repository root."),
36+
DefaultPath("."),
37+
Ignore(_SOURCE_IGNORE),
38+
] = field()
39+
40+
@check
41+
@function
42+
async def python(self) -> None:
43+
"""Run Python unit and lint checks through the root Pixi environment."""
44+
ctr = (
45+
_base()
46+
.with_directory("/workspace", self.source)
47+
.with_mounted_cache("/root/.cache/rattler/cache", dag.cache_volume("pixi-rattler-cache"))
48+
.with_mounted_cache("/root/.cache/pixi", dag.cache_volume("pixi-cache"))
49+
.with_env_variable("PIXI_NO_PROGRESS", "true")
50+
)
51+
await (
52+
ctr.with_exec(["pixi", "install", "--locked", "--environment", "default"])
53+
.with_exec(["pixi", "run", "--frozen", "test"])
54+
.with_exec(["pixi", "run", "--frozen", "lint"])
55+
.with_exec(["pixi", "run", "--frozen", "format-check"])
56+
.sync()
57+
)
58+
59+
@function
60+
async def docs_build(self) -> dagger.Directory:
61+
"""Build the static docs site."""
62+
ctr = (
63+
_base()
64+
.with_directory("/workspace", self.source)
65+
.with_mounted_cache("/root/.cache/rattler/cache", dag.cache_volume("pixi-rattler-cache"))
66+
.with_mounted_cache("/root/.cache/pixi", dag.cache_volume("pixi-cache"))
67+
.with_env_variable("PIXI_NO_PROGRESS", "true")
68+
.with_exec(["pixi", "run", "--frozen", "python", "-m", "zensical", "build", "-f", "pixi/zensical.toml"])
69+
)
70+
return ctr.directory("/workspace/pixi/site")
71+
72+
@check
73+
@function
74+
async def docs(self) -> None:
75+
"""Build the module documentation site."""
76+
await (await self.docs_build()).sync()

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.lock linguist-generated=false

.github/upstream-watch.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"upstream": {
3+
"repository": "typesafe-ai/daggerverse",
4+
"branch": "main",
5+
"base_commit": "7d07d8e68eb0678f2b022689cc191b82a5505053",
6+
"base_note": "ci: fix daggerverse publish (#69), ported to this repo"
7+
},
8+
"tracking_issue": {
9+
"title": "Review upstream typesafe-ai/daggerverse updates",
10+
"labels": ["upstream-sync"],
11+
"label_color": "5319e7"
12+
},
13+
"relevance": {
14+
"path_rules": [
15+
{
16+
"pattern": "uv/**",
17+
"reason": "Pixi follows the upstream uv module architecture"
18+
},
19+
{
20+
"pattern": ".github/workflows/**",
21+
"reason": "workflow, publish, docs, or security behavior may need porting"
22+
},
23+
{
24+
"pattern": "README.md",
25+
"reason": "root docs style is intentionally aligned with upstream"
26+
},
27+
{
28+
"pattern": "docs/**",
29+
"reason": "documentation conventions may need porting"
30+
},
31+
{
32+
"pattern": "pyproject.toml",
33+
"reason": "repo tooling and dependency changes may need porting"
34+
},
35+
{
36+
"pattern": "prek.toml",
37+
"reason": "hook policy may need porting"
38+
},
39+
{
40+
"pattern": "ruff.toml",
41+
"reason": "lint policy may need porting"
42+
},
43+
{
44+
"pattern": "*dagger.json",
45+
"reason": "Dagger module metadata may need porting"
46+
}
47+
],
48+
"message_keywords": [
49+
"ci",
50+
"daggerverse",
51+
"docs",
52+
"pinact",
53+
"publish",
54+
"ruff",
55+
"security",
56+
"uv",
57+
"workflow",
58+
"zizmor"
59+
]
60+
},
61+
"max_pages": 3
62+
}

.github/workflows/CI.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12+
13+
env:
14+
DAGGER_VERSION: "0.21.4"
15+
PIXI_VERSION: "0.70.2"
16+
17+
jobs:
18+
python:
19+
name: python
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
steps:
24+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
25+
with:
26+
persist-credentials: false
27+
28+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
29+
with:
30+
pixi-version: ${{ env.PIXI_VERSION }}
31+
frozen: true
32+
cache: false
33+
34+
- name: Unit tests
35+
run: pixi run --frozen test
36+
37+
- name: Lint
38+
run: pixi run --frozen lint
39+
40+
- name: Format check
41+
run: pixi run --frozen format-check
42+
43+
- name: Prek hooks
44+
run: pixi run --frozen pre-commit-run-all
45+
46+
windows:
47+
name: windows (${{ matrix.name }})
48+
runs-on: ${{ matrix.runner }}
49+
permissions:
50+
contents: read
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
include:
55+
- name: x64
56+
runner: windows-latest
57+
run-hooks: true
58+
- name: arm64
59+
runner: windows-11-arm
60+
run-hooks: false
61+
steps:
62+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
63+
with:
64+
persist-credentials: false
65+
66+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
67+
with:
68+
pixi-version: ${{ env.PIXI_VERSION }}
69+
frozen: true
70+
cache: false
71+
72+
- name: Unit tests
73+
run: pixi run --frozen test
74+
75+
- name: Lint
76+
run: pixi run --frozen lint
77+
78+
- name: Format check
79+
run: pixi run --frozen format-check
80+
81+
- name: Security audit
82+
run: pixi run --frozen audit-pypi
83+
84+
- name: Prek hooks
85+
if: matrix.run-hooks
86+
run: pixi run --frozen pre-commit-run-all
87+
88+
dagger:
89+
name: dagger
90+
runs-on: ubuntu-latest
91+
permissions:
92+
contents: read
93+
steps:
94+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
95+
with:
96+
persist-credentials: false
97+
98+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
99+
with:
100+
pixi-version: ${{ env.PIXI_VERSION }}
101+
frozen: true
102+
cache: false
103+
104+
- name: Run Dagger checks
105+
run: pixi run --frozen dagger-check

.github/workflows/deploy-docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: deploy-docs
10+
cancel-in-progress: false
11+
12+
env:
13+
DAGGER_VERSION: "0.21.4"
14+
PIXI_VERSION: "0.70.2"
15+
16+
jobs:
17+
deploy:
18+
name: deploy
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
steps:
28+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
29+
with:
30+
persist-credentials: false
31+
32+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
33+
with:
34+
pixi-version: ${{ env.PIXI_VERSION }}
35+
frozen: true
36+
cache: false
37+
38+
- name: Build docs
39+
run: pixi run --frozen python scripts/run_dagger.py call docs-build export --path=./public
40+
41+
- name: Upload Pages artifact
42+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
43+
with:
44+
path: ./public
45+
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to Daggerverse
2+
3+
on:
4+
push:
5+
tags: ["*/v[0-9]*"]
6+
7+
env:
8+
DAGGER_VERSION: "0.21.4"
9+
PIXI_VERSION: "0.70.2"
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
environment: daggger-publish
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Extract module from tag
20+
id: meta
21+
run: echo "module=${GITHUB_REF_NAME%%/v*}" >> "$GITHUB_OUTPUT"
22+
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
24+
with:
25+
persist-credentials: false
26+
27+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
28+
with:
29+
pixi-version: ${{ env.PIXI_VERSION }}
30+
frozen: true
31+
cache: false
32+
33+
- name: Publish ${{ steps.meta.outputs.module }}
34+
run: pixi run --frozen python scripts/run_dagger.py publish -m "./${MODULE}"
35+
env:
36+
MODULE: ${{ steps.meta.outputs.module }}
37+
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Security Audit
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**/pixi.lock"
8+
- "**/pyproject.toml"
9+
- "scripts/audit_pypi_from_pixi_lock.py"
10+
pull_request:
11+
paths:
12+
- "**/pixi.lock"
13+
- "**/pyproject.toml"
14+
- "scripts/audit_pypi_from_pixi_lock.py"
15+
schedule:
16+
- cron: "0 6 * * 1"
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
26+
env:
27+
PIXI_VERSION: "0.70.2"
28+
29+
jobs:
30+
python-pypi:
31+
name: Python PyPI (pip-audit)
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
35+
with:
36+
persist-credentials: false
37+
38+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
39+
with:
40+
pixi-version: ${{ env.PIXI_VERSION }}
41+
frozen: true
42+
cache: false
43+
44+
- name: Audit PyPI packages
45+
run: pixi run --frozen audit-pypi

0 commit comments

Comments
 (0)