-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (56 loc) · 1.45 KB
/
pull-request.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Pull request
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
- releases/*
env:
NODE_OPTIONS: '--max-old-space-size=8192'
jobs:
preflight-check:
# Prevents running the workflow when a PR is marked as draft.
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if PR is draft
id: check
run: |
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then
skip=true
else
skip=false
fi
echo "skip=${skip}" >> $GITHUB_OUTPUT
echo "skip=${skip}"
lint-and-test:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODEJS_VERSION }}
- run: npm install --immutable
- run: npm run lint
- run: npm run test --passWithNoTests
build:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODEJS_VERSION }}
- run: npm install --immutable
- run: npm run build