-
Notifications
You must be signed in to change notification settings - Fork 55
75 lines (60 loc) · 1.8 KB
/
unit-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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 }}