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
35 changes: 28 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,29 @@ name: Tests
on: [push, pull_request, workflow_dispatch]

jobs:
# Build the project with a known-good Node version that handles TypeScript 6
# well. TypeScript 6 compilation is extremely slow on Node 18/20, so we build
# once here using Node 22 and populate the wireit cache. The subsequent test
# jobs can then skip recompilation by hitting the shared wireit cache.
build:
name: Build
timeout-minutes: 5
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm

- uses: google/wireit@setup-github-actions-caching/v2
- run: npm ci
# Build through wireit so the build fingerprint is cached in the shared
# GitHub Actions cache.
- run: npm run build

tests:
needs: build
strategy:
# NODE POLICY
#
Expand All @@ -23,23 +45,20 @@ jobs:
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
matrix:
include:
# Node EOL (Oldest)
# Node Maintenance (Oldest Supported)
# on Linux/Mac/Windows (Oldest)
- node: 18
- node: 20
os: ubuntu-22.04
os-name: Linux
- node: 18
- node: 20
os: macos-14
os-name: Mac
- node: 18
- node: 20
os: windows-2022
os-name: Windows

# Node LTS (All Active & Maintenance)
# on Linux (Latest)
- node: 20
os: ubuntu-24.04
os-name: Linux
- node: 22
os: ubuntu-24.04
os-name: Linux
Expand Down Expand Up @@ -95,3 +114,5 @@ jobs:
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm run test:cache-github-real
timeout-minutes: 10
continue-on-error: true
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## [0.14.13] - 2026-06-23

### Added

- Add `WIREIT_WATCH=true` as an environment-variable escape hatch for enabling
watch mode when a package runner does not forward `--watch`.

### Fixed

- HTTP errors from the GitHub Actions cache service are no longer ever fatal,
and should always continue gracefully with GitHub Actions caching temporarily
disabled (previously only network errors and HTTP 429/503 errors failed
Expand Down Expand Up @@ -664,7 +670,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Initial release.

[unreleased]: https://github.com/google/wireit/compare/v0.14.12...HEAD
[unreleased]: https://github.com/google/wireit/compare/v0.14.13...HEAD
[0.14.13]: https://github.com/google/wireit/compare/v0.14.12...v0.14.13
[0.14.12]: https://github.com/google/wireit/compare/v0.14.11...v0.14.12
[0.14.11]: https://github.com/google/wireit/compare/v0.14.10...v0.14.11
[0.14.10]: https://github.com/google/wireit/compare/v0.14.9...v0.14.10
Expand Down
21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,23 +423,8 @@ set the `wireit.<script>.clean` property to one of these values:

In _watch_ mode, Wireit monitors all `files` of a script, and all `files` of its
transitive dependencies, and when there is a change, it re-runs only the
affected scripts. To enable watch mode, ensure that the
[`files`](#input-and-output-files) array is defined, and add the `--watch`
flag:

```sh
npm run <script> --watch
```

An additional `--` is required when using `node --run`, otherwise Node's
built-in [watch](https://nodejs.org/docs/v20.17.0/api/cli.html#--watch) feature
will be triggered instead of Wireit's:

```sh
node --run <script> -- --watch
```

If a package runner does not forward `--watch`, set `WIREIT_WATCH=true` instead:
affected scripts. To enable watch mode, first ensure that the
[`files`](#input-and-output-files) array is defined, and then run:

```sh
WIREIT_WATCH=true npm run <script>
Expand Down Expand Up @@ -891,7 +876,7 @@ The following environment variables affect the behavior of Wireit:
| `WIREIT_DEBUG_LOG_FILE` | Path to a file which will receive detailed event logging. |
| `WIREIT_MAX_OPEN_FILES` | Limits the number of file descriptors Wireit will have open concurrently. Prevents resource exhaustion when checking large numbers of cached files. Set to a lower number if you hit file descriptor limits. |
| `WIREIT_PARALLEL` | [Maximum number of scripts to run at one time](#parallelism).<br><br>Defaults to 2×logical CPU cores.<br><br>Must be a positive integer or `infinity`. |
| `WIREIT_WATCH` | Set to `true` to enable [watch mode](#watch-mode) without passing the `--watch` command-line flag. Other values are ignored. |
| `WIREIT_WATCH` | Set to `true` to enable [watch mode](#watch-mode). |
| `WIREIT_WATCH_STRATEGY` | How Wireit determines when a file has changed which warrants a new watch iteration.<br><br>Options:<br><ul><li>`event` (default): Register OS file system watcher callbacks (using [chokidar](https://github.com/paulmillr/chokidar)).</li><li>`poll`: Poll the filesystem every `WIREIT_WATCH_POLL_MS` milliseconds. Less responsive and worse performance than `event`, but a good fallback for when `event` does not work well or at all (e.g. filesystems that don't support filesystem events, or performance and memory problems with large file trees).</li></ul> |
| `WIREIT_WATCH_POLL_MS` | When `WIREIT_WATCH_STRATEGY` is `poll`, how many milliseconds to wait between each filesystem poll. Defaults to `500`. |
| `CI` | Affects the default value of `WIREIT_CACHE`.<br><br>Automatically set to `true` by [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) and most other CI (continuous integration) services.<br><br>Must be exactly `true`. If unset or any other value, interpreted as `false`. |
Expand Down
Loading
Loading