diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c8cf291 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,85 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + # ── TypeScript: typecheck all workspace recipes ──────────────────────────── + typecheck: + name: TypeScript typecheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: "10.9.0" + + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: pnpm + + - run: pnpm install --frozen-lockfile + + - run: pnpm typecheck + + # ── Prettier: check formatting ───────────────────────────────────────────── + format: + name: Format check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: "10.9.0" + + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: pnpm + + - run: pnpm install --frozen-lockfile + + - run: pnpm format:check + + # ── Python: discover all recipes and resolve dependencies ───────────────── + discover-python: + name: Discover Python recipes + runs-on: ubuntu-latest + outputs: + recipes: ${{ steps.list.outputs.recipes }} + steps: + - uses: actions/checkout@v4 + + - id: list + shell: bash + run: | + recipes=$(find recipes -name "pyproject.toml" -exec dirname {} \; | sort | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "recipes=$recipes" >> "$GITHUB_OUTPUT" + + python-sync: + name: Python sync (${{ matrix.recipe }}) + needs: discover-python + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + recipe: ${{ fromJSON(needs.discover-python.outputs.recipes) }} + steps: + - uses: actions/checkout@v4 + + - uses: astral-sh/setup-uv@v6 + with: + version: "latest" + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Sync ${{ matrix.recipe }} + run: uv sync + working-directory: ${{ matrix.recipe }} diff --git a/package.json b/package.json index 1d592a5..7e39b42 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "scripts": { "format": "prettier --write \"**/*.{ts,tsx,js,json,md,yaml,yml}\"", "format:check": "prettier --check \"**/*.{ts,tsx,js,json,md,yaml,yml}\"", - "typecheck": "pnpm -r --if-present exec tsc --noEmit" + "typecheck": "pnpm -r run --if-present typecheck" }, "devDependencies": { "prettier": "^3.4.2"