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
35 changes: 7 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# On every push / PR: build and verify output exists.
# On push to main: also deploy to GitHub Pages.
#
# The fink compiler is checked out side-by-side from main
# to satisfy the path dependency in Cargo.toml.

name: ci

Expand All @@ -19,47 +16,29 @@ jobs:
steps:
- name: Check out website
uses: actions/checkout@v4
with:
path: website

- name: Check out fink compiler
uses: actions/checkout@v4
with:
repository: fink-lang/fink
ref: main
path: fink

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('website/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Fetch dependencies
working-directory: website
run: cargo run --release -- update-deps
- name: Install dependencies
run: make deps-install

- name: Build site
working-directory: website
run: cargo run --release
run: make build

- name: Verify output
working-directory: website
run: |
test -f build/site/index.html
test -f build/site/docs/index.html
test -f build/site/404.html
test -f build/site/CNAME
test -f build/site/playground/index.html
test -f build/site/playground/playground.js
- name: Test
run: make test

- name: Upload pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: website/build/site
path: build/site

deploy:
needs: build
Expand Down
31 changes: 21 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# fink-site — project rules

## Commands

All commands are available via `make`:

| Target | Description |
|---|---|
| `make deps-check` | Check for outdated dependencies (asset releases + cargo crates) |
| `make deps-update` | Update all dependencies (`cargo update` + re-fetch assets) |
| `make deps-install` | Fetch pinned asset dependencies to `.deps/` (no `cargo update`) |
| `make clean` | Remove `build/` |
| `make build` | Build the site (`--release`) |
| `make test` | Verify expected output files exist (assumes prior `build`) |
| `make serve` | Build + start dev server at http://localhost:8080/ |

## Dependencies

All dependency versions are declared in one place:

- **Rust crates**: `Cargo.toml` `[dependencies]`
- **Asset dependencies** (e.g. playground, brand): `Cargo.toml` `[package.metadata.assets.<name>]`

### Updating dependencies

Run `cargo run -- update-deps` to update all dependencies:

1. Runs `cargo update` (Rust crates)
2. Downloads asset dependencies from GitHub releases into `.deps/`

### Build vs fetch

- `cargo run` (or `cargo run -- build`) builds with what is already in `.deps/`. It will error if a referenced asset is missing.
- `cargo run -- update-deps` fetches/updates dependencies. It does not build.
- `make build` builds with what is already in `.deps/`. It will error if a referenced asset is missing.
- `make deps-install` fetches pinned assets. `make deps-update` also runs `cargo update`.
- A clean build should never fetch dependencies.

## Project layout
Expand All @@ -32,7 +39,7 @@ static/ # static files copied verbatim to build/site/
# (brand assets here are fallbacks, overridden by .deps/brand/)
```

The dev server (`cargo run -- serve`) serves from `build/site/`.
The dev server (`make serve`) serves from `build/site/`.

## Brand assets

Expand All @@ -51,3 +58,7 @@ asset_dir: playground # copies runtime files to build/site/<path>
```

The fragment HTML is injected at build time via `{{ fragment | safe }}` in the template.

## Session wrap-up

Before wrapping up, always kill the dev server if it's running (e.g. `lsof -ti:8080 | xargs kill`).
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024"

[package.metadata.assets.playground]
url = "https://github.com/fink-lang/playground/releases/download/{version}/playground.tar.gz"
version = "v1.10.0"
version = "v1.10.2"
dest = ".deps/playground"

[package.metadata.assets.brand]
Expand All @@ -14,7 +14,7 @@ version = "v1.0.0"
dest = ".deps/brand"

[dependencies]
fink = { git = "https://github.com/fink-lang/fink.git", tag = "v0.1.0" }
fink = { git = "https://github.com/fink-lang/fink.git", tag = "v0.2.0" }
pulldown-cmark = "0.13"
tera = "1"
walkdir = "2"
Expand Down
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: deps-check deps-update deps-install clean build test serve

deps-check:
cargo run -- check-deps

deps-update:
cargo run -- update-deps

deps-install:
cargo run -- install-deps

clean:
cargo run -- clean

build:
cargo run --release -- build

test:
test -f build/site/index.html
test -f build/site/docs/index.html
test -f build/site/404.html
test -f build/site/CNAME
test -f build/site/playground/index.html
test -f build/site/playground/playground.js

serve:
cargo run -- serve
Loading