Files
directus/.github/workflows/unit-tests.yml
Pascal Jufer 6994bba791 Revise GitHub workflows #2 (#9240)
* GitHub workflow revision #2

* Add a few comments

* Add and fix comments

* Move kodiak config into .github

To not overflow the root directory

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-11-01 11:05:13 -04:00

49 lines
943 B
YAML

name: Unit Tests
on:
workflow_call:
inputs:
should_skip:
required: false
type: string
jobs:
test:
name: Test
if: inputs.should_skip != 'true'
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- '16'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run tests
run: npm run test
env:
SECRET: TEST_SECRET
result:
name: Result
if: inputs.should_skip != 'true' && always()
runs-on: ubuntu-latest
needs: test
steps:
- name: Mark result as failed
if: needs.test.result != 'success'
run: exit 1