2023-04-18 14:22:27 +02:00

43 lines
1.0 KiB
YAML

name: Tests
on: [push]
jobs:
run:
name: Run
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@main
- name: Set Node.js 16.x
uses: actions/setup-node@master
with:
version: 16.x
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '12'
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: npm install
- name: npm test
run: npm run test