Local runner for GitHub autograder

Fix Flake Inputs

bwc9876.dev 782c0a0b e2acf9d5

verified
+39 -20
+4 -2
.github/workflows/release.yml
··· 35 35 36 36 - name: Block if There's a Release 37 37 if: ${{ steps.check-tag.outputs.exists != 'false' }} 38 - run: echo "::error file=Cargo.toml,title=Refusing to Release::Tag ${{ steps.check-tag.outputs.tag }} already exists" && exit 1 38 + run: 39 + echo "::error file=Cargo.toml,title=Refusing to Release::Tag ${{ 40 + steps.check-tag.outputs.tag }} already exists" && exit 1 39 41 40 42 - name: Build 41 43 run: | ··· 44 46 - name: Generate artifact attestation 45 47 uses: actions/attest-build-provenance@v2 46 48 with: 47 - subject-path: 'target/release/gh-grader-preview' 49 + subject-path: "target/release/gh-grader-preview" 48 50 49 51 - name: Upload Binary Artifact 50 52 uses: actions/upload-artifact@v4
+15 -8
README.md
··· 1 1 # GitHub Grader Preview 2 2 3 - Simple program that runs test cases specified in an autograding.json file and reports results. Useful for previewing how GitHub will run your autograder and project. 3 + Simple program that runs test cases specified in an autograding.json file and 4 + reports results. Useful for previewing how GitHub will run your autograder and 5 + project. 4 6 5 7 > [!WARNING] 6 - > 7 - > While this works on Windows, the GitHub classroom runner uses Linux by default, and so some professors may write commands 8 - > specific to Linux meaning they won't work for you. 8 + > 9 + > While this works on Windows, the GitHub classroom runner uses Linux by 10 + > default, and so some professors may write commands specific to Linux meaning 11 + > they won't work for you. 9 12 10 13 ## Usage 11 14 ··· 13 16 gh-grader-preview 14 17 ``` 15 18 16 - Will auto-find the `autograding.json` file located in `.github/classroom` relative to the current dir. 19 + Will auto-find the `autograding.json` file located in `.github/classroom` 20 + relative to the current dir. 17 21 18 22 You can specify `-f` to choose a different file. 19 23 ··· 35 39 36 40 ### Installation 37 41 38 - Copy the binary from `target/release/gh-grader-preview` to a directory in your PATH. 42 + Copy the binary from `target/release/gh-grader-preview` to a directory in your 43 + PATH. 39 44 40 - Run `gh-grader-preview --man-page` to print the man page to stdout, and then save it to a file. 45 + Run `gh-grader-preview --man-page` to print the man page to stdout, and then 46 + save it to a file. 41 47 42 - Run `gh-grader-preview --completions=SHELL` (replace `SHELL` with `bash`, `fish`, or `zsh`) to generate a shell completion script. 48 + Run `gh-grader-preview --completions=SHELL` (replace `SHELL` with `bash`, 49 + `fish`, or `zsh`) to generate a shell completion script.
+7 -4
flake.lock
··· 22 22 ] 23 23 }, 24 24 "locked": { 25 - "lastModified": 1757940502, 26 - "narHash": "sha256-Xm0YaqIn11duN7EkFLQs0YDLWC0+rEdsE1RuQ4VABmU=", 25 + "lastModified": 1758214611, 26 + "narHash": "sha256-5YLeUhF7Nu85fNi5ElWexJ4ViiY041I0mBLLzOhg2DQ=", 27 27 "owner": "nix-community", 28 28 "repo": "flakelight", 29 - "rev": "71a933a4ce3683ba5f2bfabace834dd99f6c426a", 29 + "rev": "464ab0a32efcc4310eef119cfc6c470e267cd42a", 30 30 "type": "github" 31 31 }, 32 32 "original": { ··· 38 38 "flakelight-rust": { 39 39 "inputs": { 40 40 "crane": "crane", 41 - "flakelight": "flakelight" 41 + "flakelight": [ 42 + "flakelight" 43 + ] 42 44 }, 43 45 "locked": { 44 46 "lastModified": 1758026969, ··· 72 74 }, 73 75 "root": { 74 76 "inputs": { 77 + "flakelight": "flakelight", 75 78 "flakelight-rust": "flakelight-rust", 76 79 "nixpkgs": "nixpkgs" 77 80 }
+11 -4
flake.nix
··· 1 1 { 2 - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 3 - inputs.flakelight-rust.inputs.flakelight.inputs.nixpkgs.follows = "nixpkgs"; 4 - inputs.flakelight-rust.url = "github:accelbread/flakelight-rust"; 5 - outputs = {flakelight-rust, ...}: flakelight-rust ./. {}; 2 + inputs = { 3 + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 4 + flakelight.url = "github:nix-community/flakelight"; 5 + flakelight.inputs.nixpkgs.follows = "nixpkgs"; 6 + flakelight-rust.url = "github:accelbread/flakelight-rust"; 7 + flakelight-rust.inputs = { 8 + flakelight.follows = "flakelight"; 9 + }; 10 + }; 11 + 12 + outputs = { flakelight-rust, ... }: flakelight-rust ./. { }; 6 13 }
+1 -1
src/cli.rs
··· 1 - use clap::{Parser, command}; 1 + use clap::{command, Parser}; 2 2 3 3 #[derive(Parser)] 4 4 #[command(name="gh-grader-preview", author, version, about, long_about = None)]
+1 -1
src/runner.rs
··· 4 4 time::Duration, 5 5 }; 6 6 7 - use anyhow::{Result, anyhow}; 7 + use anyhow::{anyhow, Result}; 8 8 use wait_timeout::ChildExt; 9 9 10 10 #[cfg(not(windows))]