Skip to content

adding tests to github actions #46

adding tests to github actions

adding tests to github actions #46

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, auto_merge_enabled]
# Allow parallel jobs on `main`, so that each commit is tested. For PRs, run only the latest commit.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
name: Node.js ${{ matrix.node }}
strategy:
fail-fast: true
matrix:
node: [20, 18]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm i
#replicating calesi folder structure
- run: cd .. && mkdir calesi
- run: cd ../calesi && mkdir plugins && cd plugins && mkdir attachments
- run: cp -r ./* ../calesi/plugins/attachments
- run: cd ../calesi && git clone https://github.com/cap-js/incidents-app.git && cd incidents-app && npm install --save ../attachments/ && cp -r xmpls/attachments.cds ./db && npm i
- run: cd ../calesi/plugins/attachments && npm run test
env:
FORCE_COLOR: true
- run: rm calesi