This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (63 loc) · 1.98 KB
/
integrity.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
# Integrity Check
#
# References:
#
# - https://github.com/actions/checkout
# - https://github.com/actions/setup-node
# - https://github.com/actions/cache/tree/v2.1.6
---
name: integrity
on:
pull_request:
push:
branches:
- next
- push-action/**
workflow_dispatch:
jobs:
integrity-check:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ADMIN }}
PAT_GPR: ${{ secrets.PAT_GPR_ADMIN }}
strategy:
matrix:
node: [15.x, 16.x]
steps:
- id: checkout
name: Checkout branch
uses: actions/checkout@v2
- id: setup-node
name: Setup Node ${{ matrix.node }} environment
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
scope: '@${{ github.repository_owner }}'
# Why not using setup-node 2.2+ cache option (yet)?
# See https://github.com/belgattitude/nextjs-monorepo-example/pull/369
- id: yarn-cache-dir-path
name: Get yarn cache directory path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# Use to check for cache-hit: steps.yarn-cache.outputs.cache-hit != 'true'
- id: yarn-cache
name: Restore yarn cache
uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: |
yarn-cache-folder-os-${{ runner.os }}-node-${{ env.node-version
}}-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-os-${{ runner.os }}-node-${{ env.node-version }}-
yarn-cache-folder-os-${{ runner.os }}-
- id: install
name: Install dependencies
run: yarn install --immutable
env:
NODE_AUTH_TOKEN: ${PAT_GPR}
- id: dedupe-check
name: Check for duplicate dependencies in lock file
run: yarn check:dedupe
# - id: dependency-graph
# name: Check dependency graph
# run: yarn check:install