Skip to content

Commit 2cec2b2

Browse files
committed
minimal GHA cache check
1 parent d5b745b commit 2cec2b2

File tree

1 file changed

+20
-49
lines changed

1 file changed

+20
-49
lines changed

.github/workflows/test-linux.yml

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Linux
1+
name: Check GHA cache
22

33
on:
44
pull_request:
@@ -26,56 +26,27 @@ on:
2626
- .github/**
2727
- '!.github/workflows/test-linux.yml'
2828

29-
concurrency:
30-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
31-
cancel-in-progress: true
32-
33-
env:
34-
PYTHON_VERSION: '3.14'
35-
FLAKY_TESTS: keep_retrying
36-
CLANG_VERSION: '19'
37-
CC: sccache clang-19
38-
CXX: sccache clang++-19
39-
SCCACHE_GHA_ENABLED: 'true'
40-
SCCACHE_ERROR_LOG: '/tmp/sccache.log'
41-
SCCACHE_LOG: 'debug'
42-
RUSTC_VERSION: '1.82'
43-
44-
permissions:
45-
contents: read
46-
4729
jobs:
48-
test-linux:
49-
runs-on: ${{ matrix.os }}
50-
strategy:
51-
fail-fast: false
52-
matrix:
53-
os: [ubuntu-24.04-arm]
30+
check-cache:
31+
runs-on: ubuntu-latest
5432
steps:
55-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56-
with:
57-
persist-credentials: false
58-
path: node
59-
- name: Install Clang ${{ env.CLANG_VERSION }}
60-
uses: ./node/.github/actions/install-clang
61-
with:
62-
clang-version: ${{ env.CLANG_VERSION }}
63-
- name: Install Rust ${{ env.RUSTC_VERSION }}
33+
- name: Generate random data
6434
run: |
65-
rustup override set "$RUSTC_VERSION"
66-
rustup --version
67-
- name: Set up Python ${{ env.PYTHON_VERSION }}
68-
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
35+
GHA_CACHE_DIR="$(mktemp -d)"
36+
echo GHA_CACHE_DIR="$GHA_CACHE_DIR" >> "$GITHUB_ENV"
37+
dd if=/dev/urandom of="$GHA_CACHE_DIR/data" bs=1024 count=1
38+
- name: Store cache entry
39+
uses: actions/cache/save@v5
6940
with:
70-
python-version: ${{ env.PYTHON_VERSION }}
71-
allow-prereleases: true
72-
- name: Set up sccache
73-
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
41+
path: ${{ env.GHA_CACHE_DIR }}
42+
key: 'gha-cache-check'
43+
- name: Verify cache entry
44+
id: verify
45+
uses: actions/cache/restore@v5
7446
with:
75-
version: v0.12.0
76-
- name: Environment Information
77-
run: npx envinfo
78-
- name: Build
79-
run: make -C node build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support"
80-
- name: Print sccache log
81-
run: cat /tmp/sccache.log
47+
path: ${{ env.GHA_CACHE_DIR }}
48+
key: 'gha-cache-check'
49+
- name: Fail on cache miss
50+
if: steps.verify.outputs.cache-hit != 'true'
51+
run: exit 1
52+

0 commit comments

Comments
 (0)