test & ci: bump deps (#320) #482
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: Unit Tests | |
on: | |
# allow this workflow to be called from other workflows, namely: publish | |
workflow_call: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
tests: ${{ steps.set-tests.outputs.tests }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/workflows/shared-setup | |
- id: set-tests | |
name: Set test var for matrix | |
# run test.clj directly instead of via bb task to avoid generic task output | |
run: echo "tests=$(bb script/ci_unit_tests.clj matrix-for-ci --format=json)" >> $GITHUB_OUTPUT | |
build: | |
needs: setup | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJSON(needs.setup.outputs.tests) }} | |
name: ${{ matrix.desc }} | |
steps: | |
# | |
# Tell git not to convert newlines on checkout for Windows | |
# | |
- name: Prepare git (Windows) | |
run: git config --global core.autocrlf false | |
if: matrix.os == 'windows' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/workflows/shared-setup | |
with: | |
jdk: ${{ matrix.jdk }} | |
- name: Install Planck | |
uses: ./.github/workflows/setup-planck | |
if: contains( matrix.requires, 'planck' ) | |
- name: Node modules cache | |
uses: actions/cache@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node- | |
if: contains( matrix.requires, 'npm' ) | |
- name: Install node packages | |
run: npm ci | |
if: contains( matrix.requires, 'npm' ) | |
- name: Run Tests | |
run: ${{ matrix.cmd }} |