-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.74 KB
/
check-yarn.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
name: Check - Yarn and dependencies
on:
pull_request:
paths:
- ".github/actions/yarn-project-setup/**"
- ".github/workflows/check-yarn.yaml"
- "package.json"
- "yarn.lock"
workflow_call:
workflow_dispatch:
jobs:
duplicate-dependencies:
name: Check for duplicate dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup yarn tools
uses: ./.github/actions/yarn-project-setup
- name: Check for duplicate dependencies
run: yarn run check:yarn:dedupe
yarn-install-errors:
name: Validate Yarn install does not contain errors
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup project
uses: ./.github/actions/yarn-project-setup
- name: Yarn install output check
run: |
errors=$(yarn install --json | jq 'select(.displayName != "YN0000")')
error_count=$(echo "$errors" | jq -s 'length')
if [ "$error_count" -gt 0 ]; then
echo "Detected Yarn install errors: $error_count"
echo -e "$errors"
exit 1
fi
peer-requirements:
name: Validate yarn peer requirements
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup project
uses: ./.github/actions/yarn-project-setup
- name: Validate peer requirements are defined
run: |
reqs=$(yarn explain peer-requirements)
echo "$reqs" | grep '✘' || true
echo "$reqs" | grep -q '✘' && exit 1 || exit 0