Skip to content

Commit

Permalink
try offline
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Dec 19, 2023
1 parent 7cf3ee3 commit 24bb4ef
Showing 1 changed file with 39 additions and 17 deletions.
56 changes: 39 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,48 @@ jobs:
uses: DeLaGuardo/[email protected]
with:
lein: 2.9.8
- name: Cache local Maven repository
uses: actions/cache@v2
- name: Cache project dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
path: |
~/.m2/repository
~/.gitlibs
key: ${{ runner.os }}-clojure-${{ hashFiles('**/project.clj', '**/deps.edn') }}
restore-keys: |
${{ runner.os }}-maven-
${{ runner.os }}-clojure
- name: Warm deps cache
run: |
for i in {1..10}; do lein deps :tree && break; done
- id: set-matrix
run: |
set -x
case "${GITHUB_EVENT_NAME}" in
scheduled)
echo '::set-output name=matrix::{"jdk":["8","11","17"],"cmd":["test"]}}'
;;
# jdk 17 is slow for some reason, defer to scheduled job
#scheduled)
# echo '::set-output name=matrix::{"jdk":["8","11","17","21"],"cmd":["test"]}}'
# ;;
*)
echo '::set-output name=matrix::{"jdk":["8","11" ],"cmd":["test"]}}'
echo '::set-output name=matrix::{"jdk":["8","11","17","21"],"cmd":["test"]}}'
;;
esac
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Install Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'

- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
clj-kondo: '2023.12.15'

- name: Check clojure code
run:
clj-kondo --lint ./src --lint ./test
test:
needs: setup
strategy:
Expand All @@ -51,13 +71,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
- name: Cache project dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
path: |
~/.m2/repository
~/.gitlibs
key: ${{ runner.os }}-clojure-${{ hashFiles('**/project.clj', '**/deps.edn') }}
restore-keys: |
${{ runner.os }}-maven-
${{ runner.os }}-clojure
- name: Prepare java
uses: actions/setup-java@v2
with:
Expand All @@ -69,11 +91,11 @@ jobs:
lein: 2.9.8
- run: |
set -x
eval 'lein do clean, compile :all, ${CMD}'
env -i LEIN_OFFLINE=true sh -c "lein do clean, compile :all, ${CMD}"
env:
CMD: ${{ matrix.cmd }}
all-pr-checks:
runs-on: ubuntu-20.04
needs: test
needs: [test, lint]
steps:
- run: echo "All tests pass!"

0 comments on commit 24bb4ef

Please sign in to comment.