Compare commits

...

2 commits

Author SHA1 Message Date
9128ddb070
refactor: move scripts to scripts folder
Some checks failed
/ check (treefmt) (push) Successful in 3s
/ report-size (push) Failing after 4s
/ report-download-check (push) Has been skipped
This is a bit tidier.
2025-07-10 20:37:09 +02:00
95718c754d
feat(nix): use tarball instead of github ref
All checks were successful
/ check (treefmt) (push) Successful in 3s
/ report-size (push) Successful in 1s
/ report-download-check (push) Successful in 0s
This should make the downloads faster.
2025-07-10 20:34:51 +02:00
8 changed files with 25 additions and 28 deletions

View file

@ -56,9 +56,9 @@ For more details see the [action.yaml](./action.yml) file.
| Name | Size | Size Change | NAR Size | NAR Size Change |
|------|-----:|------------:|---------:|----------------:|
| `gemini` | 11Gi | -2.4Mi | 28Ki | 0 |
| `leo` | 1.6Gi | 0 | 25Ki | 0 |
| `libra` | 9.4Gi | -2.4Mi | 28Ki | 0 |
| `taurus` | 7.6Gi | 0 | 34Ki | 0 |
| `gemini` | 11Gi | -2.4Mi | 28Ki | 0 |
| `leo` | 1.6Gi | 0 | 25Ki | 0 |
| `libra` | 9.4Gi | -2.4Mi | 28Ki | 0 |
| `taurus` | 7.6Gi | 0 | 34Ki | 0 |
</details>

View file

@ -71,7 +71,7 @@ runs:
id: pr-number
if: inputs.comment-on-pr == 'true'
run: |
. "$GITHUB_ACTION_PATH/utils.sh"
. "$GITHUB_ACTION_PATH/scripts/utils.sh"
log 'Determine head_ref'
# For push & tag events it'll bet GITHUB_REF_NAME, for pull_request events it'll be GITHUB_HEAD_REF
@ -121,7 +121,7 @@ runs:
BASE_BRANCH: ${{ inputs.base-branch }}
JOB_NAME: ${{ inputs.job-name }}
run: |
. "$GITHUB_ACTION_PATH/utils.sh"
. "$GITHUB_ACTION_PATH/scripts/utils.sh"
# Input validation
if [ "$DO_COMPARISON" = 'true' ] && [ -z "$JOB_NAME" ]; then
@ -130,17 +130,17 @@ runs:
fi
# Create Size Report
"$GITHUB_ACTION_PATH/create-report.sh" > report.json
"$GITHUB_ACTION_PATH/scripts/create-report.sh" > report.json
# Nothing else to do
if [ "$COMMENT" != 'true' ]; then exit 0; fi
# Try to do a comparison report
if [ "$DO_COMPARISON" = 'true' ]; then
if "$GITHUB_ACTION_PATH/retrieve-old-report.sh" && [ -f old-report.json ]; then
if "$GITHUB_ACTION_PATH/scripts/retrieve-old-report.sh" && [ -f old-report.json ]; then
log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH"
"$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json
"$GITHUB_ACTION_PATH/scripts/comment_on_pr.sh" report.json old-report.json
exit 0
else
error 'Failed to do comparison, fallback to posting the report without them'
@ -149,7 +149,7 @@ runs:
# Just report values
log 'Reporting on sizes'
"$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json
"$GITHUB_ACTION_PATH/scripts/comment_on_pr.sh" report.json
- name: Upload Artifact
uses: https://git.salame.cl/actions/upload-artifact@v4
if: inputs.generate-artifact == 'true'

17
flake.lock generated
View file

@ -20,18 +20,15 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1741513245,
"narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1",
"type": "github"
"lastModified": 1752076035,
"narHash": "sha256-ROMKbpfgrbogAWXNXJxUu+BoPyZdOq/MQ3UNYVP863o=",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.11pre826938.9807714d6944/nixexprs.tar.xz?rev=9807714d6944a957c2e036f84b0ff8caf9930bc0"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs-lib": {

View file

@ -3,7 +3,7 @@
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -2,9 +2,9 @@
set -eu
util_path="${GITHUB_ACTION_PATH:-.}/utils.sh"
util_path="${GITHUB_ACTION_PATH:-.}/scripts/utils.sh"
# shellcheck source=utils.sh
# shellcheck source=scripts/utils.sh
. "${util_path}"
# USAGE: json_to_md_rows <FIELD> [JSON_FILE]

View file

@ -2,9 +2,9 @@
set -eu
util_path="${GITHUB_ACTION_PATH:-.}/utils.sh"
util_path="${GITHUB_ACTION_PATH:-.}/scripts/utils.sh"
# shellcheck source=utils.sh
# shellcheck source=scripts/utils.sh
. "${util_path}"
group 'Retrieving Flake information'

View file

@ -1,6 +1,6 @@
#!/bin/sh
. "${GITHUB_ACTION_PATH}/utils.sh"
. "${GITHUB_ACTION_PATH}/scripts/utils.sh"
repo_info() {
curl -X GET \

View file

@ -13,9 +13,9 @@ error() {
}
group() {
log "::group::$1"
echo "::group::$1"
}
endgroup() {
log '::endgroup::'
echo '::endgroup::'
}