Skip to content

Commit 0700f44

Browse files
committed
Fix
1 parent e847a65 commit 0700f44

File tree

4 files changed

+46
-43
lines changed

4 files changed

+46
-43
lines changed

.github/workflows/clean.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,30 @@ jobs:
1818
console.log(`Deleting caches matching pattern: ${cacheKeysPattern}`);
1919
2020
// Fetch all cache entries for the repository
21-
const caches = await github.actions.getActionsCacheList({
21+
const caches = await github.rest.actions.getActionsCacheList({
2222
owner: context.repo.owner,
2323
repo: context.repo.repo,
2424
});
2525
26-
// Filter caches matching the specified pattern
27-
const matchingCaches = caches.data.actions_caches.filter(cache =>
28-
cache.key.startsWith(cacheKeysPattern)
29-
);
26+
if (caches.data) {
27+
// Filter caches matching the specified pattern
28+
const matchingCaches = caches.data.actions_caches.filter(cache =>
29+
cache.key.startsWith(cacheKeysPattern)
30+
);
3031
31-
// Delete matching caches
32-
for (const cache of matchingCaches) {
33-
/*
34-
await github.actions.deleteActionsCacheByKey({
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
key: cache.key
38-
});
39-
*/
40-
console.log(`Deleted cache with key: ${cache.key}`);
41-
}
32+
// Delete matching caches
33+
for (const cache of matchingCaches) {
34+
/*
35+
await github.rest.actions.deleteActionsCacheById({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
cache_id: cache.id
39+
});
40+
*/
41+
console.log(`Deleted cache with key: ${cache.key}`);
42+
}
4243
43-
console.log(`Deleted ${matchingCaches.length} caches.`);
44+
console.log(`Deleted ${matchingCaches.length} caches.`);
45+
}
4446
env:
4547
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/hw.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/cache/restore@v4
2929
with:
3030
lookup-only: true
31-
key: tests-hw-${{ env.id}}
31+
key: tests-hw-${{ env.id }}
3232
path: |
3333
tests/**/*.xml
3434
tests/**/result_*.json
@@ -60,29 +60,29 @@ jobs:
6060
6161
echo "enabled=$enabled" >> $GITHUB_OUTPUT
6262
63-
- name: Get binaries
64-
id: cache-build-binaries
65-
uses: actions/cache/restore@v4
63+
- name: Checkout repository
6664
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
65+
uses: actions/checkout@v4
6766
with:
68-
fail-on-cache-miss: true
69-
key: tests-bin-${{ env.id }}
70-
path: |
71-
~/.arduino/tests/**/build*.tmp/*.bin
72-
~/.arduino/tests/**/build*.tmp/*.elf
73-
~/.arduino/tests/**/build*.tmp/*.json
67+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
7468

7569
- uses: actions/setup-python@v5
7670
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
7771
with:
7872
cache: 'pip'
7973
python-version: '3.10.1'
8074

81-
- name: Checkout repository
75+
- name: Get binaries
76+
id: cache-build-binaries
77+
uses: actions/cache/restore@v4
8278
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
83-
uses: actions/checkout@v4
8479
with:
85-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
80+
fail-on-cache-miss: true
81+
key: tests-bin-${{ env.id }}
82+
path: |
83+
~/.arduino/tests/**/build*.tmp/*.bin
84+
~/.arduino/tests/**/build*.tmp/*.elf
85+
~/.arduino/tests/**/build*.tmp/*.json
8686
8787
- name: Install dependencies
8888
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ permissions: read-all
1616
jobs:
1717
call-build-tests:
1818
name: Build tests
19+
if: github.event.action != 'closed'
1920
uses: ./.github/workflows/build_tests.yml
2021

2122
call-hardware-tests:
@@ -46,8 +47,8 @@ jobs:
4647

4748
call-clean:
4849
name: Clean objects
49-
needs: [call-build-tests, call-hardware-tests, call-wokwi-tests]
5050
uses: ./.github/workflows/clean.yml
51+
needs: [call-build-tests, call-hardware-tests, call-wokwi-tests]
5152
if: always() && (github.event_name != 'pull_request' || github.event.action == 'closed')
5253
permissions:
5354
actions: write

.github/workflows/wokwi.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@ jobs:
4848
4949
echo "enabled=$enabled" >> $GITHUB_OUTPUT
5050
51-
- name: Get binaries
51+
- name: Checkout Repository
52+
uses: actions/checkout@v4
5253
if: steps.check-tests.outputs.enabled == 'true'
53-
id: cache-build-binaries
54-
uses: actions/cache/restore@v4
5554
with:
56-
fail-on-cache-miss: true
57-
key: tests-bin-${{ env.id }}
58-
path: |
59-
~/.arduino/tests/**/build*.tmp/*.bin
60-
~/.arduino/tests/**/build*.tmp/*.elf
61-
~/.arduino/tests/**/build*.tmp/*.json
55+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
6256

6357
- uses: actions/setup-python@v5
6458
if: steps.check-tests.outputs.enabled == 'true'
6559
with:
6660
cache: 'pip'
6761
python-version: '3.x'
6862

69-
- name: Checkout Repository
70-
uses: actions/checkout@v4
63+
- name: Get binaries
7164
if: steps.check-tests.outputs.enabled == 'true'
65+
id: cache-build-binaries
66+
uses: actions/cache/restore@v4
7267
with:
73-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
68+
fail-on-cache-miss: true
69+
key: tests-bin-${{ env.id }}
70+
path: |
71+
~/.arduino/tests/**/build*.tmp/*.bin
72+
~/.arduino/tests/**/build*.tmp/*.elf
73+
~/.arduino/tests/**/build*.tmp/*.json
7474
7575
- name: Install Wokwi CLI
7676
if: steps.check-tests.outputs.enabled == 'true'

0 commit comments

Comments
 (0)