Skip to content

Commit

Permalink
ci(node): added support to ci to only run if the backend files have c…
Browse files Browse the repository at this point in the history
…hanged
  • Loading branch information
DarrellRichards committed Sep 19, 2020
1 parent b56a7fa commit 8071cb3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,25 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Checks if the subfolder files have changed for the backend /src
- uses: dorny/paths-filter@v2.2.0
id: filter
with:
filters: |
backend:
- 'src/**'
# Installs packages, if a backend file has changed
- name: Install Packages
if: steps.filter.outputs.backend == 'true'
run: npm install
# Creates a ENV file, if a backend file has changed
- name: Create Env File
if: steps.filter.outputs.backend == 'true'
run: |
touch .env
echo JWT_KEY="test" >> .env
echo JWT_REFRESH_KEY="test" >> .env
# Runs backend tests, if a backend file has changed
- name: Backend Tests
if: steps.filter.outputs.backend == 'true'
run: npm run test:node

0 comments on commit 8071cb3

Please sign in to comment.