Skip to content
Merged
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
40 changes: 33 additions & 7 deletions .github/workflows/netsukefile-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,39 @@ jobs:
run: make build
- name: Create Netsukefile
run: |
cat <<-'MANIFEST' > Netsukefile
cat <<- 'MANIFEST' > Netsukefile
netsuke_version: "1.0.0"
targets:
- name: generated.txt
command: "touch generated.txt"
- name: base.txt
command: "touch base.txt"
- name: dependent.txt
command: "cp base.txt dependent.txt"
sources: ["base.txt"]
- name: inline-command.txt
command: "touch inline-command.txt"
- name: inline-script.txt
script: |
#!/bin/sh
touch inline-script.txt
actions:
- name: say-hello
command: "touch action-called.txt"
- name: unused-action
command: "touch unused.txt"
MANIFEST
- name: Run Netsuke
run: ./target/debug/netsuke --verbose build generated.txt
- name: Assert artefact exists
run: scripts/assert-file-exists.sh generated.txt
- name: Build dependent and inline targets
run: ./target/debug/netsuke --verbose build dependent.txt inline-command.txt inline-script.txt
- name: Assert dependent artefacts exist
run: |
scripts/assert-file-exists.sh base.txt
scripts/assert-file-exists.sh dependent.txt
- name: Assert inline command artefact exists
run: scripts/assert-file-exists.sh inline-command.txt
- name: Assert inline script artefact exists
run: scripts/assert-file-exists.sh inline-script.txt
- name: Run action target
run: ./target/debug/netsuke --verbose build say-hello
- name: Assert action artefact exists
run: scripts/assert-file-exists.sh action-called.txt
- name: Assert unused action artefact absent
run: test ! -f unused.txt
Comment on lines +53 to +68
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Group all build targets in a single Netsuke invocation to cut CI time

You launch Netsuke twice: once for the three inline/dependency targets and once for say-hello.
Building everything in one call avoids the second binary start-up, re-parsing of the manifest and cache lookup, shaving a few seconds off each run.

-      - name: Build dependent and inline targets
-        run: ./target/debug/netsuke --verbose build dependent.txt inline-command.txt inline-script.txt
+      - name: Build all required targets
+        run: ./target/debug/netsuke --verbose build \
+          dependent.txt inline-command.txt inline-script.txt say-hello
...
-      - name: Run action target
-        run: ./target/debug/netsuke --verbose build say-hello
+      # call above already builds say-hello
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build dependent and inline targets
run: ./target/debug/netsuke --verbose build dependent.txt inline-command.txt inline-script.txt
- name: Assert dependent artefacts exist
run: |
scripts/assert-file-exists.sh base.txt
scripts/assert-file-exists.sh dependent.txt
- name: Assert inline command artefact exists
run: scripts/assert-file-exists.sh inline-command.txt
- name: Assert inline script artefact exists
run: scripts/assert-file-exists.sh inline-script.txt
- name: Run action target
run: ./target/debug/netsuke --verbose build say-hello
- name: Assert action artefact exists
run: scripts/assert-file-exists.sh action-called.txt
- name: Assert unused action artefact absent
run: test ! -f unused.txt
- name: Build all required targets
run: ./target/debug/netsuke --verbose build \
dependent.txt inline-command.txt inline-script.txt say-hello
- name: Assert dependent artefacts exist
run: |
scripts/assert-file-exists.sh base.txt
scripts/assert-file-exists.sh dependent.txt
- name: Assert inline command artefact exists
run: scripts/assert-file-exists.sh inline-command.txt
- name: Assert inline script artefact exists
run: scripts/assert-file-exists.sh inline-script.txt
# call above already builds say-hello
- name: Assert action artefact exists
run: scripts/assert-file-exists.sh action-called.txt
- name: Assert unused action artefact absent
run: test ! -f unused.txt
🤖 Prompt for AI Agents
In .github/workflows/netsukefile-test.yml around lines 53 to 68, the workflow
runs the Netsuke build command twice separately for different targets, causing
unnecessary overhead. To fix this, combine all build targets (dependent.txt,
inline-command.txt, inline-script.txt, and say-hello) into a single Netsuke
invocation by listing them all in one command line. This reduces CI time by
avoiding multiple binary startups and repeated manifest parsing.

Loading