forked from namespacelabs/nscloud-cache-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow to test caching when the job requires container enviro…
…nment.
- Loading branch information
1 parent
344aba3
commit fe6df3a
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test in a container | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "*" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
in-container: | ||
runs-on: | ||
- namespace-profile-e2e-small | ||
|
||
container: | ||
image: node:21 | ||
env: | ||
NSC_CACHE_PATH: ${{ env.NSC_CACHE_PATH }} | ||
volumes: | ||
- /cache:/cache | ||
options: --cap-add=SYS_ADMIN | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install sudo | ||
run: | | ||
apt-get update -y && apt-get install -y sudo | ||
- name: Set up Nix cache | ||
uses: namespacelabs/nscloud-cache-action@344aba36b864a47c4bae7ea0c0aff4cda7e6d50a | ||
with: | ||
path: .npm | ||
|
||
- name: Run npm install | ||
run: npm install | ||
|
||
- name: Print cache metadata file | ||
run: cat /cache/.ns/cache-metadata.json |