-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 1010 Bytes
/
pull-request.yml
File metadata and controls
36 lines (33 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Pull Request workflow
on:
pull_request:
# Only accept PRs targeting the master branch
branches: [main]
jobs:
test:
name: App linting/testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup NodeJS LTS
uses: actions/setup-node@v6
with:
node-version: '18.x'
- name: Cache node modules
uses: actions/cache@v5
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-node_modules-
${{ runner.os }}-
- name: Install dependencies
# Skip this step if a cache hit occurs on the key
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci
- name: Lint application
run: npm run lint
- name: Test application
run: npm run action:test