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
44 changes: 44 additions & 0 deletions .github/workflows/netsukefile-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Netsukefile Build Test

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
netsukefile:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup Rust
uses: leynos/shared-actions/.github/actions/setup-rust@c6559452842af6a83b83429129dccaf910e34562
- name: Cache Cargo
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build Netsuke
run: make build
- name: Create Netsukefile
run: |
cat <<-'MANIFEST' > Netsukefile
netsuke_version: "1.0.0"
targets:
- name: generated.txt
recipe:
kind: command
command: "touch generated.txt"
MANIFEST
- name: Run Netsuke
run: ./target/debug/netsuke build generated.txt
- name: Assert artefact exists
run: scripts/assert-file-exists.sh generated.txt
4 changes: 2 additions & 2 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ compilation pipeline from parsing to execution.

- **Success Criterion:**

- [ ] Netsuke can successfully take a Netsukefile without any Jinja syntax,
- [x] Netsuke can successfully take a Netsukefile without any Jinja syntax,
compile it to a `build.ninja` file, and execute it via the ninja subprocess
to produce the correct build artifacts.
to produce the correct build artefacts. *(validated via CI workflow)*

## Phase 2: The Dynamic Engine ✨

Expand Down
16 changes: 16 additions & 0 deletions scripts/assert-file-exists.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Ensures the Netsuke build produced the expected artefact.
# Fails fast if the given file is missing.
set -euo pipefail

if [[ $# -ne 1 ]]; then
echo "Usage: $(basename "$0") <file>" >&2
exit 64 # EX_USAGE
fi

file="$1"

if [[ ! -f "$file" ]]; then
echo "Expected build artefact '$file' to exist." >&2
exit 1
fi
Loading