Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/cleanup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ runs:
if: always()
shell: bash
run: |
git clean -fxd || true
sudo git clean -fxd || true
2 changes: 1 addition & 1 deletion .github/resources/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

self-hosted-runner:
# Labels of self-hosted runner in array of strings.
labels: [all, bat]
labels: [all, bat, to-be-cleaned]

# Configuration variables in array of strings defined in your repository or
# organization. `null` means disabling configuration variables check.
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/clean-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ run-name: "[CI] Clean self-hosted runner"

on:
workflow_dispatch: {}
schedule:
- cron: "0 4 * * *" # Run daily at 04:00 UTC

# Only run at most 1 workflow concurrently per PR or per branch to keep costs down
concurrency:
Expand All @@ -21,8 +19,15 @@ permissions:
jobs:
clean-runner:
name: "Clean self-hosted runner"
runs-on: [self-hosted]
runs-on: [to-be-cleaned]
steps:
- name: "Clean workdir before checkout"
run: |
sudo rm -rf $GITHUB_WORKSPACE/* || true
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Cleanup
if: always()
uses: ./.github/actions/cleanup
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests-bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ jobs:
needs: [filter, check-pr-state]
if: ${{ needs.filter.outputs.code_changed == 'true' && (needs.check-pr-state.outputs.pr_state != 'true' || github.event_name == 'workflow_dispatch') }}
steps:
- name: "Remove all Docker images"
if: ${{ github.event.inputs.cleanup == 'true' }}
uses: ./.github/actions/cleanup
with:
system-prune: "true"

- name: "Checkout Repository"
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false

- name: "Remove all Docker images"
if: ${{ github.event.inputs.cleanup == 'true' }}
uses: ./.github/actions/cleanup
with:
system-prune: "true"

- name: "Run Basic Acceptance Tests (BAT)"
run: |
make clean-all
Expand Down
Loading