mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
MONGO_URI: mongodb://localhost:27017
|
|
MONGO_DATABASE: evaluetonsavoir
|
|
|
|
jobs:
|
|
lint-and-tests:
|
|
strategy:
|
|
matrix:
|
|
directory: [client, server]
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: ${{ matrix.directory }}/package-lock.json
|
|
|
|
- name: Process ${{ matrix.directory }}
|
|
working-directory: ${{ matrix.directory }}
|
|
timeout-minutes: 5
|
|
run: |
|
|
echo "::group::Installing dependencies for ${{ matrix.directory }}"
|
|
npm ci
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::Running ESLint"
|
|
npx eslint . || {
|
|
echo "ESLint failed with exit code $?"
|
|
exit 1
|
|
}
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::Running Tests"
|
|
npm test
|
|
echo "::endgroup::"
|
|
|