Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CI caching wasn't working #913

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/actions/build-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ name: Build Cache
description: Cache builds
runs:
using: "composite"
# Make sure to keep these cache entries in sync with those in writecache.yml
steps:
- name: Cache Go Modules
- name: Restore Go Modules Cache
id: cache-go-modules
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-{{ hashFiles('**/go.sum') }}-go
- name: Cache Maven Modules
- name: Restore Maven Modules Cache
id: cache-maven
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-{{ hashFiles('**/pom.xml') }}-maven
- name: Populate Cache
id: populate-cache
uses: ./.github/actions/populate-cache

6 changes: 0 additions & 6 deletions .github/actions/populate-cache/action.yml

This file was deleted.

Empty file.
12 changes: 0 additions & 12 deletions .github/actions/populate-cache/post.js

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ jobs:
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Test
run: |
find ~/.m2 -ls
mvn test --batch-mode
run: mvn test --batch-mode
test:
name: Test Go
runs-on: ubuntu-latest
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/writecache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
branches:
- main
name: Write Cache
jobs:
write-cache:
name: Write Cache
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Download Maven Dependencies
run: mvn dependency:resolve --batch-mode
- name: Download Go Dependencies
run: go mod download -x
- name: Save Go Modules Cache
id: cache-go-modules
uses: actions/cache/save@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-{{ hashFiles('**/go.sum') }}-go
- name: Save Maven Modules Cache
id: cache-maven
uses: actions/cache/save@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-{{ hashFiles('**/pom.xml') }}-maven