Run tests in GitHub actions

This commit is contained in:
Jeroen Engels 2021-11-20 14:05:25 +01:00
parent 069cd16909
commit c8950f9977

35
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,35 @@
# This is a basic workflow to help you get started with Actions
name: CI
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-ubuntu-${{ hashFiles('yarn.lock') }}
- name: yarn
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: yarn
- name: Run tests
run: npm test