Commit graph

48 commits

Author SHA1 Message Date
awalsh128 754c4194f6 docs(action): clarify version and execute_install_scripts inputs
Describe version as a user defined value and link the README caveats by
URL, since the bare README.md reference doesn't resolve from the
Marketplace or the workflow editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:14:13 -08:00
Andrew Walsh 5905c29b85
perf: speed up cache restores (#243)
* fix: find install scripts for package names with regex metacharacters

findInstallScript built a regex from the raw package name, so names like
g++ or libstdc++6 threw "Nothing to repeat" on cache save and on restore
with install scripts, and a '.' in a name could match another package's
script. Compare file names as plain strings instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf: speed up cache restores

- Upload the diagnostic artifact only when debug is on or the action
  fails. The upload took ~1.4s of a ~3.7s restore in CI.
- Extract all package archives in one sudo shell when install scripts
  are off, instead of a sudo and tar process per package. Per-package
  extraction stays when scripts run, to keep install ordering (#196).
- Skip the apt-fast availability probe on a cache hit, where nothing is
  installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: document Manifest and ManifestEntry public members

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:44:39 -08:00
Andrew Walsh a84878c774
ci: bundle the action with rollup and upload it for integration jobs (#233)
* ci: bundle the action with rollup and upload it for integration jobs

The integration jobs download an action-bundle-<sha> artifact that
nothing built or uploaded, so all of them failed on their first step.
v2 also had no bundle: action.yml runs dist/index.js, and an action has
no node_modules at runtime.

- Add rollup.config.mjs, which bundles the tsc output (dist/src) into a
  self-contained dist/index.js. npm run build now runs it.
- Fix the setup action, which never built: with if_no_artifact_found:
  ignore the download step always succeeds, so check found_artifact.
  Download cached builds into dist/, and overwrite the build artifact
  since several jobs in a run can build it.
- Upload action.yml and the bundle as action-bundle-<sha> from
  setup-and-cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chor: remove stale file

* fix: write logs under the home cache directory and await artifact upload

Instruments opened its log files at the relative path cache-apt-pkgs/
before that directory existed, so the action crashed at startup with
ENOENT. It also pointed artifact uploads there while Cache uses
~/cache-apt-pkgs. Resolve both with a shared resolveCacheDir helper and
create the directory before opening the logs.

The artifact upload was also never awaited, so a failed upload became an
unhandled rejection. Await it and report failures as a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: ship ts-apt's apt-fast script with the bundle

On runners with aria2 installed, ts-apt uses apt-fast and spawns
scripts/dist/apt-fast.sh relative to its own module. Bundling moved that
module, so the action failed with "spawn .../scripts/dist/apt-fast.sh
ENOENT".

Write the bundle to dist/action/index.js and copy ts-apt's scripts/dist
to dist/scripts/dist, which is where ts-apt looks from there. Point
action.yml at the new entrypoint and include both in the action bundle
artifact. Workflow artifacts drop file modes, so the action marks the
script executable at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build: pin ts-apt to e627c3b for install timeout and dpkg-query fixes

ts-apt killed every apt command after 30 seconds, so installs failed
with exit code 124, and listInstalledFiles passed name=version to
dpkg-query -L, which rejects it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: make diagnostic artifact names unique per step

Every job in a run uploaded capa_artifacts-<run id>, so only the first
upload succeeded. Add the run attempt, job and step IDs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: run cache restore jobs after the jobs that create the cache

The restore and add-package jobs all only needed testing, so they ran in
parallel with standard_workflow_install and raced on the same cache key.
Restore the ordering v1 uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: authenticate the action pin check to avoid API rate limits

The check called the GitHub API anonymously and hit the rate limit for
the shared runner IP. The script uses GITHUB_TOKEN when it's set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build: pin ts-apt to 342c7d0 for native arch and stdin input

Adds PackageManager.getNativeArchitecture and CommandOptions.input, used by the version-list outputs and archive creation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: report requested and dependency package versions separately

package-version-list held every installed package and both outputs were
identical. Outputs also carried arch suffixes inconsistently and followed
install order.

- package-version-list lists only requested packages; all-package-version-list
  lists every installed package.
- Entries are name=version, with :arch only for packages installed for a
  non-native architecture (e.g. libc6:i386), so native output matches v1.
- Entries are sorted with PackageName.compareTo.
- Requested packages are matched by name, and by arch when both specify one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: archive and restore packages with system tar under sudo

The in-process tar library ran as the runner user, so archiving failed on
root-only files such as /etc/default/cacerts from ca-certificates-java
(regression #72), and extraction could skip root-owned paths without failing.

- Create and extract with sudo tar; the file list is piped NUL-separated on
  stdin so large packages don't exceed the argument size limit.
- Keep directory symlinks such as /lib on extract.
- Hand archives back to the runner user for the cache save.
- Disable the command timeout for tar and maintainer scripts.
- Record the installed (versioned) entries in manifest_main.json; it held
  unversioned names with no files.
- Return every installed package on a cache hit so outputs include deps.
- Split runInstallScripts into per-script runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: update package expectations for Ubuntu 24.04

libasound2 is libasound2t64 on 24.04 (regression #81), and gir1.2-gdkpixbuf-2.0 moved to 2.42.10+dfsg-3ubuntu3.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: add ts-apt boundary rules to AGENTS.md

APT and dpkg logic belongs in ts-apt; ts-apt changes are pushed before the action bumps its pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: pin version-list jobs to ubuntu-24.04 and fix spaces-in-paths tests

- list_versions / list_all_versions: run on ubuntu-24.04. The expected
  versions are from 24.04, but ubuntu-latest now resolves newer ones
  (e.g. rolldice=1.16-1build4, xdot=1.6-1).
- regression_76: cache libopenal-data ("Default HRTF.mhr") instead of
  Intel oneAPI. Drops the Intel repo and the unused opencl and
  libsundials-dev installs (188 MB, 155 packages), which made the job
  take 75+ minutes when the Ubuntu mirror was slow. Cap at 15 minutes.
- regression_81: list alsa-ucm-conf explicitly so the test caches a
  package with spaces in its file paths.

Same fixes as #235 and #236 on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:39:31 -08:00
awalsh128 1d921eeba9 fixed errors and restoring as a pure port from v1 2026-06-28 15:56:51 -07:00
awalsh128 42b6b9694b Draft of v2 2026-06-28 13:27:41 -07:00
Takahiro Ueda a605dbde2a
Add empty_packages_behavior option to handle empty package list (#154)
Available options: 'error' (default), 'warn' and 'ignore'.
2025-08-16 19:34:34 -07:00
Max Schwenk 5902b33ae2
Upgrade to cache v4 (#140) 2025-01-09 11:16:31 -08:00
Hadrien G 75ab37ec52
Use matching versions of actions/cache actions (#123)
Needed to finish migration to node20 + probably wiser overall to use matching versions of the caching actions.
2024-02-13 21:38:36 -08:00
Daniel Possenriede 5c74a020dc
Bump actions/cache/restore to v4 (#120) 2024-02-01 13:13:10 -08:00
Andrew Walsh 44c33b32f8
Pull staging changes upstream. (#113)
* Pull dev upstream to staging. (#112)

* Use awk to enclose filename in single quotes tar #99

* Add null field separator so filenames don't get broken up.

* Move upload logs up in the action sequence so it captures data before it gets deleted.

* Fix awk (#109)

---------

Co-authored-by: sn-o-w <cristian.silaghi@mozilla.ro>

* Fix awk delimiter.

Pull in fix by @sn-o-w in d0ee83b497 mentioned in issue #99

---------

Co-authored-by: sn-o-w <cristian.silaghi@mozilla.ro>
2023-10-30 11:12:50 -07:00
awalsh128 1850ee53f6 Documentation for versioning support. 2023-03-24 04:50:32 -07:00
Pascal Roeleven 946776e670
Clean cache directory after use (#95) 2023-03-06 06:56:37 -08:00
awalsh128 5b6c3ab114 Add deprecation message to obsolete input. 2023-02-04 20:30:40 -08:00
Andrew Walsh 622a4c5687
Sync dev to master. (#93)
* Address block style package issue #84 #88

* Use cache key for upload artifact name #89.

* Sync master back to dev. (#92)

* Fix if condition for upload-logs step (#87)

Previously the if condition was always evaluating to a truthy string
(e.g. 'false == "true"' or 'true == "true"') as the string comparison
(`== 'true'`) was not inside the expression syntax (`${{ }}`) and thus
being treated as a string rather than being evaluated.

* Introduce a force update value for reloading cache #82

---------

Co-authored-by: Leroy Hopson <github@leroy.geek.nz>

---------

Co-authored-by: Leroy Hopson <github@leroy.geek.nz>
2023-02-03 23:16:50 -08:00
Leroy Hopson 9b2b4f2004
Fix if condition for upload-logs step (#87)
Previously the if condition was always evaluating to a truthy string
(e.g. 'false == "true"' or 'true == "true"') as the string comparison
(`== 'true'`) was not inside the expression syntax (`${{ }}`) and thus
being treated as a string rather than being evaluated.
2023-01-16 19:29:46 -08:00
Andrew Walsh d07fc5d9ff
Workaround for #71. Due to a bug in the runner actions/runner#716 (#75) 2022-12-07 22:11:01 -08:00
Andrew Walsh 51678ad913
Execute installation scripts feature, debug mode, and permission denied fix. (#65)
* Execute installation scripts and debug mode features. (#64)

* Provide the ability to call Debian package manager installation scripts (i.e. `*.[preinst, postinst]`).
* Introduce a debug mode that runs the scripts in verbose mode and uploads the logs for retrieval.
* Updated README to reflect new features and provided more info on how to use the action versions.

* Dev (#66)

* Fix permission denied error.

* Fix permission denied error. (#51)

* Remove compression from file caching. (#53)

* Draft of postinst support from issue #44.

* Remove bad option.

* Removed extraneous line.

* Cover no packages edge case when writing manifest.

* Fix postinst bugs and add docs to lib.

* Made cache directory variable and more refinements to postinst.

* Update deprecated option.

https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

* Rollback accidental commit of new postinst feature.

* Minor edit ands full install script execution FR.

* Fix execute_install_scripts message to show the right param name.

* Fix param check.

* Minor fix to doc.

* Upload action logs for debugging.

* Make artifact names unique.

* Add debug option.

* Update description.

* Debug package list issue.

* Rollback 76128c60a1

* Revert outputs set behavior to see if it fixes outputs issue in dev.

* Restore updated outputs behavior. So strange it is working when I revert.

* Fix bugs in install script execution.

* Add error suppression on file testing.

* Debug feature.

* Link to the issue that started the postinst troubleshooting.

* Describe action version usage.

* Fix package outputs command.
2022-11-23 22:24:00 -08:00
Andrew Walsh 677fd9bce5
Update deprecated set-output command #58 (#59) 2022-10-30 11:49:55 -07:00
awalsh128 f1a79a837b Minor bug. 2022-07-19 20:51:50 -07:00
awalsh128 b61cf9a6f1 Copy from staging to dev. 2022-07-19 20:42:48 -07:00
Andrew Walsh 17cdbf8735
Revert "Cache non explicitly listed packages" 2022-06-03 20:30:40 -07:00
Nate Bohman 6d622023ef
Also Cache Non-Explicitly Listed APT PKGs
Apt installs more packages than just those explicitly listed. This can
lead to issues of missing files when the cache is restored.
2022-03-18 09:39:17 -06:00
awalsh128 8f2c275875 Remove refresh feature. 2021-10-21 23:04:42 -07:00
awalsh128 95b1f6f538 Remove extraneous arg. 2021-10-21 21:30:33 -07:00
awalsh128 38009341b0 Multiline pre cache for greater readability. 2021-10-21 21:13:01 -07:00
awalsh128 63a7ea6f1c Fix post cache action args. 2021-10-21 21:03:30 -07:00
awalsh128 e5a9854ee1 Consolidate steps, and make reporting less verbose. 2021-10-21 20:57:52 -07:00
awalsh128 a191e661e6 Fix version reporting. 2021-10-21 16:05:02 -07:00
awalsh128 feb88c8d01 Fix output setter. 2021-10-21 15:54:16 -07:00
awalsh128 76fa489e74 Add refresh and package version I/O. 2021-10-21 15:44:19 -07:00
awalsh128 407650fe3b Append cache key directly to env. 2021-10-16 22:46:41 -07:00
awalsh128 8df0022f2d Extra character. 2021-10-16 22:37:51 -07:00
awalsh128 82c659a794 Validate version and break out cache key creation logic. 2021-10-16 22:37:18 -07:00
awalsh128 3dc9d0c3ae Fix variable reference. 2021-10-16 22:10:40 -07:00
awalsh128 7313869349 Fix missing command. 2021-10-16 22:04:08 -07:00
awalsh128 9c18c92e77 Hash on content and not on file state. 2021-10-16 22:02:56 -07:00
awalsh128 c014946be0 Added coment to esoteric expression. 2021-10-16 21:17:41 -07:00
awalsh128 2530518f4a Try again. 2021-10-16 13:16:36 -07:00
awalsh128 dcae10197c Update output to emit false. 2021-10-16 13:10:59 -07:00
awalsh128 2780a91363 Change file pathing to see if hashFiles works. 2021-10-16 12:48:07 -07:00
awalsh128 7dfe2c32f2 Add versioning. 2021-10-16 11:34:03 -07:00
awalsh128 d88f9cf209 Another script name fix. :( 2021-10-16 11:25:42 -07:00
awalsh128 c29b0d7f9a Fix script reference. 2021-10-16 11:22:48 -07:00
awalsh128 132be8a450 More fixes. Gotta love not having tests. directly for GitHub actions. 2021-10-16 11:19:36 -07:00
awalsh128 d3f2f7ce23 Fix conditionals. 2021-10-16 11:15:06 -07:00
awalsh128 7a02db3b2e Fix if variable. 2021-10-16 10:54:31 -07:00
awalsh128 3ac364cc33 Add branding to action.yml 2021-10-13 22:16:32 -07:00
awalsh128 b07ee5cce8 Initial commit. 2021-10-13 21:11:27 -07:00