Skip to content

Merge pull request #831 from OCLC-Developer-Network/eol #549

Merge pull request #831 from OCLC-Developer-Network/eol

Merge pull request #831 from OCLC-Developer-Network/eol #549

Workflow file for this run

name: Run tests on pull request
on:
push:
branches:
- master
paths-ignore:
- '.lib/**'
- '.husky/**'
- '.eslintrc'
- '.gitignore'
- '.travis.yml'
- 'Makefile'
- 'README.md'
- 'fields.json'
- 'mime.json'
- 'rid.json'
- 'rtype.json'
pull_request:
branches:
- '*'
paths-ignore:
- '.lib/**'
- '.husky/**'
- '.eslintrc'
- '.gitignore'
- '.travis.yml'
- 'Makefile'
- 'README.md'
- 'fields.json'
- 'mime.json'
- 'rid.json'
- 'rtype.json'
env:
NODE_VERSION: '14'
jobs:
run-tests:
runs-on: ubuntu-latest
environment: development
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: .lib/package-lock.json
- name: Make install
run: make install
- name: Get changed files
id: changed-parser
uses: tj-actions/changed-files@v35
with:
files: |
**/*.js
files_ignore: .lib/**
- name: Run mocha tests
shell: bash
run: |
PLATFORMS=""
for file in ${{ steps.changed-parser.outputs.all_modified_files }}; do
PLATFORMS="$PLATFORMS $(echo $file | grep "/" | grep -v "^\." | cut -d "/" -f1 | uniq)"
done
if [ -n "$PLATFORMS" ]; then
echo "$PLATFORMS" | xargs make test
if [ $? -ne 0 ]; then exit 1; fi
fi