Skip to content

Commit 1eb8a1c

Browse files
committed
Harden CI runner usage and cache strategy
1 parent 82114c3 commit 1eb8a1c

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
env:
2323
CARGO_TERM_COLOR: always
2424
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
25+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2526

2627
concurrency:
2728
group: ci-${{ github.event.pull_request.number || github.ref }}
@@ -81,6 +82,15 @@ jobs:
8182
submodules: true
8283
token: ${{ secrets.GH_PAT }}
8384

85+
- name: Free disk space and show usage
86+
run: |
87+
echo "Disk usage before cleanup"
88+
df -h
89+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/.ghcup
90+
docker system prune -af || true
91+
echo "Disk usage after cleanup"
92+
df -h
93+
8494
- name: Install Rust nightly
8595
run: |
8696
rustup toolchain install nightly --profile minimal --component clippy
@@ -102,17 +112,23 @@ jobs:
102112
libxslt1-dev \
103113
libicu-dev
104114
105-
- name: Cache cargo dependencies
115+
- name: Cache cargo-pgrx tool
116+
uses: actions/cache@v4
117+
with:
118+
path: |
119+
~/.cargo/.crates2.json
120+
~/.cargo/bin/cargo-pgrx
121+
key: ${{ runner.os }}-cargo-pgrx-0.16.1-v1
122+
123+
- name: Cache Cargo dependency sources
106124
uses: actions/cache@v4
107125
with:
108126
path: |
109127
~/.cargo/registry
110128
~/.cargo/git
111-
~/.cargo/bin/cargo-pgrx
112-
target
113-
key: ${{ runner.os }}-cargo-pg${{ matrix.pg_version }}-${{ hashFiles('**/Cargo.lock') }}
129+
key: ${{ runner.os }}-cargo-deps-${{ hashFiles('**/Cargo.lock') }}
114130
restore-keys: |
115-
${{ runner.os }}-cargo-pg${{ matrix.pg_version }}-
131+
${{ runner.os }}-cargo-deps-
116132
117133
- name: Cache PostgreSQL build
118134
uses: actions/cache@v4

0 commit comments

Comments
 (0)