build: use recommended GraalVM lib #172
Workflow file for this run
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
name: Test and Deploy | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Babashka | |
uses: DeLaGuardo/[email protected] | |
with: | |
bb: 'latest' | |
- name: Apply Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.deps.clj | |
~/.gitlibs | |
key: lint-graal-build-time-${{ hashFiles('deps.edn','bb.edn') }} | |
restore-keys: "lint-graal-build-time-" | |
- name: Lint | |
run: bb lint | |
test: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- 'ubuntu' | |
- 'windows' | |
distribution: | |
- 'graalvm' | |
- 'graalvm-community' | |
java-version: | |
- '17.0.8' | |
- '20.0.2' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup GraalVM | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: ${{ matrix.distribution }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Babashka | |
uses: DeLaGuardo/[email protected] | |
with: | |
bb: 'latest' | |
- name: Tools versions | |
run: | | |
java --version | |
bb --version | |
- name: Apply Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.deps.clj | |
~/.gitlibs | |
key: ${{ runner.os }}-graal-build-time-${{ hashFiles('**/deps.edn') }} | |
restore-keys: ${{ runner.os }}-graal-build-time- | |
- name: Run tests | |
run: bb test | |
- name: Run native tests | |
run: bb native-image-test | |
deploy: | |
needs: [lint, test] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Babashka | |
uses: DeLaGuardo/[email protected] | |
with: | |
bb: 'latest' | |
# any JDK > JDK8 will do to compile sources, but let's deliberately choose one | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Tools versions | |
run: | | |
java --version | |
bb --version | |
- name: Apply Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.deps.clj | |
~/.gitlibs | |
key: ${{ runner.os }}-graal-build-time-${{ hashFiles('**/deps.edn') }} | |
restore-keys: ${{ runner.os }}-graal-build-time- | |
- name: Deploy to clojars | |
env: | |
CLOJARS_USERNAME: ${{ secrets.CLOJARS_ORG_USERNAME }} | |
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_ORG_PASSWORD }} | |
run: bb deploy |