Commit graph

174 commits

Author SHA1 Message Date
Andrew Walsh
6460a33c29
First version of a Golang version for APT package querying. (#118) (#119)
* 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

* Swap out Bash based APT query logic for Golang version. (#117)

* First version of a Golang version of command handling in general. (#118)

---------

Co-authored-by: sn-o-w <cristian.silaghi@mozilla.ro>
2023-12-22 10:28:03 -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
Andrew Walsh
6f9e6a86db
Update README.md 2023-10-11 08:11:43 -07:00
Steven Hartland
641f947ac2
fix: apt cache performance (#104)
* fix: apt cache performance

Use a single call to apt-cache to reduce the time needed to lookup
package versions.

Also:
* Added millisecond details to log timing so slow operations can be more
  easily identified.
* Perform apt update before determining package versions.

Fixes #103

* chore: descriptive variable names and use log_err

Added the review feedback, updating variable names to be more
descriptive and using log_err where appropriate.
2023-10-11 08:07:11 -07:00
awalsh128
1850ee53f6 Documentation for versioning support. 2023-03-24 04:50:32 -07:00
Andrew Walsh
135ee20306
Merge branch 'dev' into master 2023-03-23 23:51:02 -07:00
awalsh128
0a4812359d Revert package existence test. 2023-03-23 22:58:47 -07:00
awalsh128
6d3c7590b1 Test apt-cache show command wrt versioning. 2023-03-23 22:33:59 -07:00
awalsh128
f5bcdd76d3 Use APT syntax for name version delimitation and not a colon. 2023-03-23 22:19:43 -07:00
awalsh128
cdad971850 Fix broken function calls. 2023-03-23 20:50:29 -07:00
awalsh128
971da5988a Standardize syntax, name casing and fix package versioning feature. 2023-03-23 20:20:24 -07:00
awalsh128
bd5455834e Convert action to APT version syntax. 2023-03-13 21:43:46 -07:00
awalsh128
a644619d1f Enclose filenames in single quotes to capture literals #99 2023-03-13 21:24:13 -07:00
Pascal Roeleven
bdc09286d1
Only install apt-fast from source if not present (#97)
* Revert "Don't install apt-fast from source (#96)"

This reverts commit 854bb539e1.

* Only install apt-fast from source if not present
2023-03-08 09:04:22 -08:00
Pascal Roeleven
946776e670
Clean cache directory after use (#95) 2023-03-06 06:56:37 -08:00
Pascal Roeleven
854bb539e1
Don't install apt-fast from source (#96) 2023-03-06 06:54:18 -08:00
John Hughes
797d1a2f52
More robust checking of age of apt cache (#90) 2023-02-11 21:36:46 -08:00
awalsh128
270eae5fc9 Remove commas, and block scalar folded backslashes #84 2023-02-04 21:08:45 -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
awalsh128
e649dfdfe5 Merge branch 'master' of https://github.com/awalsh128/cache-apt-pkgs-action 2023-02-03 12:43:05 -08:00
awalsh128
9ecdf39b43 Introduce a force update value for reloading cache #82 2023-02-03 12:42: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
awalsh128
9b3b2b590c Enclose tar files in quotes #79. 2023-01-02 16:49:35 -08:00
Kévin Dunglas
a71b0ea8ac
docs: fix link to actions/cache (#77) 2022-12-19 12:48:58 -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
9bc3e210f3
Fix ordering of library function call and include of library #68
Fix validation bool function and turn on halt and exit flag `set -e` to guard against regression.
2022-11-24 08:59:56 -08:00
awalsh128
982de21c87 Fix execute bits. 2022-11-23 23:02:00 -08:00
awalsh128
4fcaa16dbf Merge branch 'master' of https://github.com/awalsh128/cache-apt-pkgs-action 2022-11-23 23:00:06 -08:00
Andrew Walsh
c51c800bea
Dev (#67)
* 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.

* 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.

* Restore execute bit for script.

* Fix execute bit on script.
2022-11-23 22:32:40 -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
276bbdc9f3
Update issue templates 2022-11-23 22:13:12 -08:00
Mickaël Schoentgen
d93c95e39c
Skip apt-fast installation on cache hit (#61) 2022-11-15 07:45:14 -08:00
Andrew Walsh
677fd9bce5
Update deprecated set-output command #58 (#59) 2022-10-30 11:49:55 -07:00
Andrew Walsh
c58510bf41
Remove compression from file caching. (#53) (#54) (#55) 2022-09-03 21:40:21 -07:00
Andrew Walsh
09f9c08872
Fix permission denied error. (#51) 2022-09-01 14:40:15 -07:00
Andrew Walsh
fc1d3efd6e
Update README.md to use latest release in examples. 2022-08-02 23:16:37 -07:00
Andrew Walsh
91b541353e
Fix issues #36, #37, and minor refactors. (#40) (#41)
* Bump license year.
* Fix pre-existing dep bug in issue #36.
* Account for packages without deps.
* Fix bug in issue #37 by combining install and dep listing reads. Ensures only installed deps are cached.
* Fix bad log lines.
* Use apt-fast to show package information and remove CLI warning message.
* Switch to apt-cache for package verification and remove CLI warning message.
2022-08-02 21:14:51 -07:00
Andrew Walsh
c5df606b25
Optimize installs with apt-fast and various minor cleanups. (#35)
* Fix cut regression.

Originally fixed in #17. This was reintroduced when master was sync'd to staging.

* Update pre_cache_action.sh

* Switch to CLI safe apt command.

Address concern in issue #23.

* Optimize installs with apt-fast and cleanup logging.
2022-07-23 17:06:17 -07:00
Andrew Walsh
97133735cc
Fix cut regression.
Originally fixed in #17. This was reintroduced when master was sync'd to staging.
2022-07-20 10:58:33 -07:00
Andrew Walsh
704b3e1a64
Merge pull request #27 from awalsh128/staging
Rollup staging to master.
2022-07-19 21:12:46 -07:00
Andrew Walsh
c4bc8b6ed5
Merge branch 'master' into staging 2022-07-19 21:12:17 -07:00
awalsh128
e3e8536b71 Add newline at EOF to lib.sh 2022-07-19 21:08:41 -07:00
awalsh128
d3470979cf Fix all-package-version-list output bug. 2022-07-19 21:01:08 -07:00
awalsh128
f1a79a837b Minor bug. 2022-07-19 20:51:50 -07:00
awalsh128
8af57b352e Fix all packages reporting. 2022-07-19 20:46:02 -07:00
awalsh128
1e75d90dc9 Merge script include snippet. 2022-07-19 20:44:04 -07:00
awalsh128
b61cf9a6f1 Copy from staging to dev. 2022-07-19 20:42:48 -07:00
Andrew Walsh
a85a2de3b3 Update installation to consider symlinks as well.
Addresses problem raised in #25
2022-07-19 20:34:24 -07:00
awalsh128
c58b29a1aa Merge branch 'staging' of https://github.com/awalsh128/cache-apt-pkgs-action into staging 2022-07-19 20:03:15 -07:00