From f58ff407b33ba42ee34f2fabd27301b5a1c63d02 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sat, 12 Apr 2025 00:02:09 +0300 Subject: [PATCH] ci: report cache hit/miss --- .forgejo/workflows/release.yml | 19 ++++++++++++++----- .forgejo/workflows/test.yaml | 13 ++++++++++--- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 3aa053bd..482ce6e0 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -1,11 +1,16 @@ -on: [tag] +on: + push: + tags: '*' jobs: build: container: { image: "alpine:edge" } steps: - name: install deps - run: apk add --no-cache nodejs tree rustup git just cloc build-base clang20-dev pipewire-jack-dev lilv-dev serd-dev + run: apk add --no-cache bash nodejs tree rustup git just cloc build-base clang20-dev pipewire-jack-dev lilv-dev serd-dev + + - run: git clone --depth 1 --recursive $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . + - run: whoami && pwd && tree && cloc src/ && cloc . - id: cache name: cache restore @@ -19,9 +24,13 @@ jobs: ~/.cargo/git/db/ target/ - - run: git clone --depth 1 --recursive $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . - - run: whoami && pwd && tree - - run: cloc src/ && cloc . + - name: cache hit + if: steps.cache.outputs.cache-hit == 'true' + run: echo "cache hit! :)" + - name: cache miss + if: steps.cache.outputs.cache-miss != 'true' + run: echo "cache miss! :(" + - run: rustup-init -y - run: source "$HOME/.cargo/env" && rustup install nightly && rustup default nightly && cargo version -vv #- run: source "$HOME/.cargo/env" && RUSTFLAGS="-Ctarget-feature=-crt-static" just doc diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml index 5080c58c..1cd650a3 100644 --- a/.forgejo/workflows/test.yaml +++ b/.forgejo/workflows/test.yaml @@ -7,6 +7,9 @@ jobs: - name: install deps run: apk add --no-cache nodejs tree rustup git just cloc build-base clang20-dev pipewire-jack-dev lilv-dev serd-dev + - run: git clone --depth 1 --recursive $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . + - run: whoami && pwd && tree && cloc src/ && cloc . + - id: cache name: cache restore uses: https://data.forgejo.org/actions/cache/restore@v4 @@ -19,12 +22,16 @@ jobs: ~/.cargo/git/db/ target/ - - run: git clone --depth 1 --recursive $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . - - run: whoami && pwd && tree + - name: cache hit + if: steps.cache.outputs.cache-hit == 'true' + run: echo "cache hit! :)" + - name: cache miss + if: steps.cache.outputs.cache-miss != 'true' + run: echo "cache miss! :(" + - run: cloc src/ && cloc . - run: rustup-init -y - run: source "$HOME/.cargo/env" && rustup install nightly && rustup default nightly && cargo version -vv - #- run: source "$HOME/.cargo/env" && RUSTFLAGS="-Ctarget-feature=-crt-static" just doc - run: source "$HOME/.cargo/env" && RUSTFLAGS="-Ctarget-feature=-crt-static" just test - run: tree