-
Notifications
You must be signed in to change notification settings - Fork 8
69 lines (59 loc) · 1.59 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
59
60
61
62
63
64
65
66
67
68
69
name: Pull request
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
- releases/*
env:
NODE_OPTIONS: '--max-old-space-size=8192'
# See https://github.com/cypress-io/cypress/issues/25357
ELECTRON_EXTRA_LAUNCH_ARGS: --disable-gpu
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
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: |
corepack enable
corepack prepare [email protected] --activate
- 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-build:
# Execute lint and build when a PR is ready
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable Corepack
run: |
corepack enable
corepack prepare [email protected] --activate
- run: yarn install --immutable
- run: yarn all:lint
- run: yarn all:build