-
Notifications
You must be signed in to change notification settings - Fork 105
73 lines (67 loc) · 1.98 KB
/
branch.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: v4.x branch
on:
push:
branches:
- v4.x
jobs:
install:
name: Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache node_modules
id: cacheModules
uses: actions/cache@v4
with:
path: ~/.npm # this is the cache where npm installs from before going out to the network
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- name: Install dependencies
if: steps.cacheDist.outputs.cache-hit != 'true'
run: npm install
build:
name: Build
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore node_modules
uses: actions/cache@v4
with:
path: ~/.npm # this is the cache where npm installs from before going out to the network
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- name: Cache dist
id: cacheDist
uses: actions/cache@v4
with:
path: ./dist
key: ${{ runner.os }}-node-${{ hashFiles('package.json', 'rollup.config.js', 'src/*.js') }}
- name: Build cross-fetch
if: steps.cacheDist.outputs.cache-hit != 'true'
run: make dist
debug:
name: Debug
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v3
checks:
name: Check
needs: [build]
uses: ./.github/workflows/checks.yml
with:
ref: ${{ github.sha }}
# The security job can't run on pull requests opened from forks because
# Github doesn't pass down the SNYK_TOKEN environment variable.
security:
name: Check Security
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.npm # this is the cache where npm installs from before going out to the network
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- run: npm install --prefer-offline
- run: make secure
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}