Skip to content

Commit

Permalink
Use magic nix cache and nix develop command in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
john-shaffer committed Dec 28, 2023
1 parent 3f58dff commit 6083c87
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v3
id: cache
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9

- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Cache Clojure dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-rate-limit-${{ hashFiles('**/deps.edn') }}
restore-keys: ${{ runner.os }}-rate-limit
key: clj-${{ github.repository }}-${{ hashFiles('**/deps.edn') }}
restore-keys: clj-${{ github.repository }}-
path: |
~/.gitlibs
~/.m2
- name: Install Nix
uses: cachix/install-nix-action@v24

- run: nix-build
~/.m2/repository
- run: nix-shell --run "clj -T:build ci :snapshot false"
- name: Run tests
run: nix develop -c clj -T:build ci :snapshot false

- name: Deploy release jar
run: nix-shell --run "clojure -T:build deploy :snapshot false"
run: nix develop -c clojure -T:build deploy :snapshot false
env:
CLOJARS_PASSWORD: ${{secrets.CLOJARS_PASSWORD}}
CLOJARS_USERNAME: ${{secrets.CLOJARS_USERNAME}}
24 changes: 13 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v3
id: cache
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9

- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Cache Clojure dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-rate-limit-${{ hashFiles('**/deps.edn') }}
restore-keys: ${{ runner.os }}-rate-limit
key: clj-${{ github.repository }}-${{ hashFiles('**/deps.edn') }}
restore-keys: clj-${{ github.repository }}-
path: |
~/.gitlibs
~/.m2
- name: Install Nix
uses: cachix/install-nix-action@v24

- run: nix-build
~/.m2/repository
- run: nix-shell --run "clj -T:build ci :snapshot true"
- name: Run tests
run: nix develop -c clj -T:build ci :snapshot true

0 comments on commit 6083c87

Please sign in to comment.