Skip to content

Commit b0c21e8

Browse files
committed
ci: delete build outputs if tests succeed
1 parent 7737740 commit b0c21e8

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
pull_request_target:
66

77
permissions:
8+
actions: write
89
contents: read
910
packages: write
1011

.github/workflows/test-src.yml

+11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
required: true
1717
type: string
1818

19+
permissions:
20+
actions: write
21+
1922
env:
2023
INTEGRATION_TESTS_ARGS: "--extended --exclude feature_pruning,feature_dbcrash"
2124

@@ -62,6 +65,14 @@ jobs:
6265
|| echo "upload-logs=false" >> "${GITHUB_OUTPUT}"
6366
shell: bash
6467

68+
- name: Delete build outputs cache
69+
run: |
70+
git config --global --add safe.directory "$(pwd)"
71+
gh cache delete "${{ inputs.build-key }}"
72+
echo "::warning:: Build outputs cache \"${{ inputs.build-key }}\" deleted on successful test run. Attempting to rerun \"${{ inputs.build-target }}-test\" will fail!"
73+
env:
74+
GH_TOKEN: ${{ github.token }}
75+
6576
- name: Upload test logs
6677
uses: actions/upload-artifact@v4
6778
if: |

contrib/containers/ci/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ RUN set -ex; \
146146
mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz
147147
ENV PATH="/opt/shellcheck:${PATH}"
148148

149+
RUN set -ex; \
150+
mkdir -p -m 755 /etc/apt/keyrings; \
151+
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg > /etc/apt/keyrings/github.gpg && chmod go+r /etc/apt/keyrings/github.gpg; \
152+
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/github.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list; \
153+
apt-get update && apt-get install $APT_ARGS gh \
154+
&& rm -rf /var/lib/apt/lists/*;
155+
149156
# Setup unprivileged user and configuration files
150157
ARG USER_ID=1000 \
151158
GROUP_ID=1000

0 commit comments

Comments
 (0)