~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/steps

Shared steps for knotless workflows: Node, npm, Rust lint, coverage tools, SSH keys and waiting for checks

0
main
64 lines · 2.5 KB Raw History

Steps

Shared steps for knotless workflows. Each is a file under .knotless/steps/, released on its own as @step/<name>.

Use one in place of a run step, then pin it with knotless uses update:

steps:
  - uses: chadtmiller.com/steps/npm-ci@1
    with: {dir: web}

Commit the .knotless/uses.lock it writes. Runs read it.

StepWhat it doesInputsCache
nodeInstalls Node.js at a version and puts node, npm and npx on the path.version (required), dir/opt/node
npm-ciRuns npm ci only when package-lock.json has changed since the last install.dir, omit<dir>/node_modules
rust-lintRuns cargo fmt --check, then clippy with warnings denied.clippytarget, /usr/local/cargo/registry, /usr/local/rustup
cargo-llvm-covInstalls cargo-llvm-cov at a version, with llvm-tools.version (required), dir/opt/tools, /usr/local/rustup
ssh-keyWrites the SSH key from the secret SSH_KEY to ~/.ssh.name, known-hosts
wait-for-checksWaits for this commit's checks of other workflows to pass. Use it before deploying.workflows (required), minutes
publish-lexiconsPublishes the lexicons whose authority is in a zone: schema records in an account, and _lexicon TXT records naming it. Plans only unless write is true.did (required), zone (required), dir, write

ssh-key needs the secret passed to it by name:

secrets: [SSH_KEY]
steps:
  - uses: chadtmiller.com/steps/ssh-key@1
    with: {known-hosts: "example.com ssh-ed25519 AAAA…"}
    secrets: [SSH_KEY]

wait-for-checks waits wherever it runs. To wait only where a later step deploys, give it the same on:

steps:
  - uses: chadtmiller.com/steps/wait-for-checks@2
    on: {refs: [refs/heads/main]}
    with: {workflows: check test}

publish-lexicons takes the account's app password as LEX_PASSWORD, and CLOUDFLARE_API_TOKEN, with Zone:DNS:Edit on the zone, to change the DNS. Planning needs neither:

secrets: [LEX_PASSWORD, CLOUDFLARE_API_TOKEN]
steps:
  - uses: chadtmiller.com/steps/publish-lexicons@1
    with: {did: "did:plc:…", zone: example.com, write: "true"}
    secrets: [LEX_PASSWORD, CLOUDFLARE_API_TOKEN]

Each step's needs lists the commands it expects in the image, checked before it runs. A new version of a step is released with:

knotless publish knotless://chadtmiller.com/steps @step/<name> <version> \
  .knotless/steps/<name>.yml --commit <sha>