Skip to content

Commit 1cf24b0

Browse files
committed
Optimize Copilot setup workflow with build caching
Added comprehensive caching strategy to significantly speed up Copilot workspace setup: - Add _build cache for compiled artifacts (prevents full recompilation) - Add PLT cache for Dialyzer type checking (very slow to rebuild) - Add explicit compilation steps (deps.compile + compile) - Improve cache keys to include source code hashes for better hit rates Expected performance improvement: 2-4x faster setup (from ~3min to ~30sec on cache hits) Mirrors the optimization strategy from comprehensive-ci.yml workflow.
1 parent 9aeb6c6 commit 1cf24b0

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,41 @@ jobs:
5151
elixir-version: '1.19'
5252
otp-version: '28'
5353

54-
- name: Restore Elixir dependencies cache
54+
- name: Cache Mix dependencies
5555
uses: actions/cache@v4
5656
with:
5757
path: deps
58-
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
59-
restore-keys: ${{ runner.os }}-mix-
58+
key: ${{ runner.os }}-mix-deps-${{ hashFiles('**/mix.lock') }}
59+
restore-keys: |
60+
${{ runner.os }}-mix-deps-
6061
61-
- name: Install Elixir dependencies
62+
- name: Cache compiled build
63+
uses: actions/cache@v4
64+
with:
65+
path: _build
66+
key: ${{ runner.os }}-mix-build-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('lib/**/*.ex') }}
67+
restore-keys: |
68+
${{ runner.os }}-mix-build-${{ hashFiles('**/mix.lock') }}-
69+
${{ runner.os }}-mix-build-
70+
71+
- name: Cache PLT files
72+
uses: actions/cache@v4
73+
with:
74+
path: priv/plts
75+
key: ${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('lib/**/*.ex') }}
76+
restore-keys: |
77+
${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }}-
78+
${{ runner.os }}-plt-
79+
80+
- name: Install dependencies
6281
run: mix deps.get
6382

83+
- name: Compile dependencies
84+
run: mix deps.compile
85+
86+
- name: Compile application
87+
run: mix compile
88+
6489
- name: Wait for PostgreSQL and create test database
6590
run: |
6691
# Wait for PostgreSQL to be ready

0 commit comments

Comments
 (0)