Skip to content

Commit a89f94b

Browse files
perf: Add caching for SOCRATES binaries and AGNI Julia depot
Implements performance optimizations to reduce CI runtime: 1. Cache SOCRATES compiled binaries (~7-8 min savings) - Caches socrates/ directory with binaries - Key based on source file hashes for automatic invalidation - Restore-keys for partial cache hits 2. Cache AGNI Julia depot (~3-4 min savings) - Caches AGNI/ directory and ~/.julia/ packages - Key based on Julia source and manifest files - Restore-keys for partial cache hits Expected improvement: 10-12 minutes saved per CI run (from ~26 to ~14-16 minutes) These caches only rebuild when source files change, otherwise use cached binaries/packages from previous runs.
1 parent d016472 commit a89f94b

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ name: CI Tests for PROTEUS # Continuous Integration Tests for PROTEUS
22

33
# Trigger on pushes/PRs to main and dev branches, plus manual workflow_dispatch
44
# Aligned with existing tests.yaml structure for consistency
5-
# Temporarily includes tl/test_ecosystem_v1 for testing
5+
# Temporarily includes tl/test_ecosystem_v1 and v2 for testing
66
on:
77
push:
88
branches:
99
- main
1010
- dev
1111
- tl/test_ecosystem_v1
12+
- tl/test_ecosystem_v2
1213
pull_request:
1314
branches:
1415
- main
@@ -152,6 +153,30 @@ jobs:
152153
python -m pip install -e ./MORS
153154
python -m pip install -e ./aragog
154155
156+
# Cache SOCRATES compiled binaries to avoid 7-8 minute recompilation
157+
# Key based on SOCRATES repository content hash for automatic invalidation
158+
- name: Cache SOCRATES binaries
159+
uses: actions/cache@v4
160+
id: cache-socrates
161+
with:
162+
path: socrates/
163+
key: socrates-bins-${{ runner.os }}-${{ hashFiles('socrates/**/*.f90', 'socrates/**/*.F90', 'socrates/**/*.c', 'socrates/build_code', 'socrates/configure') }}
164+
restore-keys: |
165+
socrates-bins-${{ runner.os }}-
166+
167+
# Cache AGNI Julia depot to avoid 3-4 minute package installation
168+
# Includes both Julia packages and AGNI installation
169+
- name: Cache AGNI Julia depot
170+
uses: actions/cache@v4
171+
id: cache-agni
172+
with:
173+
path: |
174+
AGNI/
175+
~/.julia/
176+
key: agni-depot-${{ runner.os }}-${{ hashFiles('AGNI/**/*.jl', 'AGNI/**/Project.toml', 'AGNI/**/Manifest.toml') }}
177+
restore-keys: |
178+
agni-depot-${{ runner.os }}-
179+
155180
- name: Install all PROTEUS external repo dependencies via cli.py.
156181
run:
157182
proteus install-all --export-env

0 commit comments

Comments
 (0)