diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9963dd..fd70eef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -191,3 +191,44 @@ jobs: N_TRIALS: ${{ steps.hbench.outputs.n-trials }} run: | [[ "$MEAN_REWARD" == 1.0 && "$N_TRIALS" == 1 ]] + + run-config: + name: Keep the job name a config sets, unless job-name replaces it + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - name: Check out the repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Run a config that sets job_name + id: named + uses: ./ + with: + config: tests/configs/named-job.json + min-mean-reward: '1' + upload-artifact: 'false' + - name: Run it again under the name job-name sets + id: renamed + uses: ./ + with: + config: tests/configs/named-job.json + job-name: renamed-job + min-mean-reward: '1' + upload-artifact: 'false' + - name: Run a config that sets no job_name + id: unnamed + uses: ./ + with: + config: tests/configs/unnamed-job.yaml + min-mean-reward: '1' + upload-artifact: 'false' + - name: Check the job directories and the names hbench recorded + env: + NAMED: ${{ steps.named.outputs.job-dir }} + RENAMED: ${{ steps.renamed.outputs.job-dir }} + UNNAMED: ${{ steps.unnamed.outputs.job-dir }} + run: | + [[ "$(basename "$NAMED")" == named-job && "$(jq -r .job_name "$NAMED/config.json")" == named-job ]] + [[ "$(basename "$RENAMED")" == renamed-job && "$(jq -r .job_name "$RENAMED/config.json")" == renamed-job ]] + [[ "$(basename "$UNNAMED")" == "$GITHUB_JOB"-* && -f "$UNNAMED/result.json" ]] diff --git a/README.md b/README.md index 5e9e273..7b913b6 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,11 @@ To run Claude Code instead, add your Anthropic key as a repository secret and pa n-tasks: 5 ``` -The scores go to the job summary, and the job's files are uploaded as an artifact. +The scores go to the job summary, and the job's files are uploaded as an artifact. `n-tasks: 5` runs 5 of the +dataset's 89 tasks; leave it out to run them all. A score compares only with runs of the same tasks: the same +dataset and version from the same registry, with the same `n-tasks`, `include` and `exclude`. To run a job +spec you were given, under the job name it sets, pass it as `config` alone (see +[Run a job spec](docs/REFERENCE.md#more-examples)). For a whole repository to fork, with three tasks, the workflow that checks them on every pull request and workflows that run agents on them, see @@ -100,7 +104,7 @@ For hbench itself, the docs are at [nodeq.tech/docs](https://nodeq.tech/docs): # registry: oci://ghcr.io/node-q/hbench-datasets # dataset: my-tasks@1.0 # or a dataset listed in a registry.json # registry: registry.json # a path, or an https:// URL - # config: job.yaml # or a job config (YAML/JSON) + # config: job.yaml # or a job config (YAML/JSON), run under its job_name # Who runs it agent: claude-code # default: oracle diff --git a/action.yml b/action.yml index 34ea22f..e0c67f8 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,7 @@ branding: inputs: version: - description: hbench release to install, such as v0.3.0, or latest. + description: hbench release to install, such as v0.3.5, or latest. default: latest verify-provenance: description: Check the release archive's build provenance with gh attestation verify. true, false, or auto (when the GitHub CLI is installed). @@ -20,13 +20,13 @@ inputs: description: A task directory, or a directory of task directories (hbench run --path). Set path, dataset or config to run; with none of them the action only installs hbench. default: '' dataset: - description: Dataset to run, name@version (hbench run --dataset). Needs registry. + description: Dataset to run, name@version (hbench run --dataset), from registry. With no registry, hbench 0.3.3 and later read it from $HBENCH_REGISTRY, else oci://ghcr.io/node-q/hbench-datasets. default: '' registry: - description: Where the dataset is listed. An OCI registry, oci:///, or OCI image layouts on disk, oci-layout: (hbench run --registry); or a registry.json, by https:// URL (--registry-url) or path (--registry-path). + description: Where the dataset is listed. An OCI registry, oci:///, or OCI image layouts on disk, oci-layout: (hbench run --registry); or a registry.json, by https:// URL (--registry-url) or path (--registry-path). Empty uses hbench's default registry. default: '' config: - description: Job config, YAML or JSON (hbench run --config). The other inputs override it. + description: Job config, YAML or JSON (hbench run --config). The other inputs override it. Unless job-name is set, the job keeps the config's job_name. default: '' agent: description: Agent to run (hbench run --agent); hbench agents list shows them. Empty runs hbench's default, the oracle. @@ -61,6 +61,9 @@ inputs: jobs-dir: description: Where hbench writes the job directory. Empty uses hbench-jobs under the runner's temporary directory. default: '' + job-name: + description: Name of the job directory (hbench run --job-name). Empty keeps the job_name the config sets, and otherwise uses -