-
Notifications
You must be signed in to change notification settings - Fork 92
49 lines (40 loc) · 1.13 KB
/
pr_on_master.yml
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
# File for Pull Request on main branch
name: PR on main
# When a PR is opened to main
on:
pull_request:
branches:
- main
types: [opened, reopened, synchronize]
env:
BEFORE_SHA: ${{ github.event.before }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
build:
# Setup OS and Node Version
runs-on: ubuntu-latest
strategy:
matrix:
# Latest nodes only
node-version: [18]
# Define Steps
steps:
# Checkout code
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# Make sure we have all branches
- name: Fetch other branches
run: git fetch --no-tags --prune --depth=5 origin main
- name: Install environment
run: npm install
- name: Run lint
run: npm run affected:lint -- --base="origin/main"
- name: Tests coverage
run: npm run affected:test -- --base="origin/main" --codeCoverage