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

CI improvements #288

Merged
merged 9 commits into from
Nov 3, 2024
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ jobs:
with:
path: ~/.elm
key: elm-${{ runner.os }}-${{ hashFiles('**/elm.json', 'elm-tooling.json') }}
restore-keys: |
elm-${{ runner.os }}-
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows but I still don't get how this is not dangerous.

If elm.json has changed, then recovering from other caches seems like a recipe for problems, though I don't understand what it recovers. What am I missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Say I've got an elm.json with elm-review@2.14.1 and elm-syntax@8.3.4. I bump elm-syntax, so the old cache is invalidated, but it'll still grab the last cache from the same branch, then main (so you can't get a cache from a fork and get a supply-chain attack), so elm make doesn't have to redownload the unchanged elm-review. Then, it'll upload the new cache (with the new elm-syntax) with a new hash.
It has the potential to create larger caches, but if it becomes a problem, you can just clear the cache.


- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
node_modules-${{ runner.os }}-

- name: Cache turbo build setup
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand All @@ -88,7 +92,7 @@ jobs:
- name: Install turbo
run: npm install -g turbo

- name: Test nodejs version requirements
- name: Test Node.js version requirements
run: turbo run check-engines

- name: Run tests
Expand Down