-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
74 lines (65 loc) · 2.07 KB
/
yarn-validation.yml
File metadata and controls
74 lines (65 loc) · 2.07 KB
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
74
name: Yarn validation
on:
pull_request:
paths:
- .github/workflows/yarn-validation.yml
- '**/package.json'
- '**/yarn.lock'
merge_group:
branches:
- main
push:
branches:
- main
paths:
- .github/workflows/yarn-validation.yml
- '**/package.json'
- '**/yarn.lock'
workflow_call:
workflow_dispatch:
jobs:
check:
if: github.repository == 'software-mansion/react-native-gesture-handler'
runs-on: ubuntu-latest
env:
YARN_ENABLE_HARDENED_MODE: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v6
- name: Install root dependencies
run: yarn install
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
**/package.json
**/yarn.lock
files_ignore: |
packages/react-native-gesture-handler/DrawerLayout/package.json
packages/react-native-gesture-handler/ReanimatedDrawerLayout/package.json
packages/react-native-gesture-handler/Swipeable/package.json
packages/react-native-gesture-handler/ReanimatedSwipeable/package.json
packages/react-native-gesture-handler/jest-utils/package.json
- name: Get list of changed directories
id: changed-dirs
run: |
ECHOLIST=()
for CHANGE in ${{ steps.changed-files.outputs.all_changed_files }}
do
DIR=$(dirname "$CHANGE")
ECHOLIST+=("$DIR")
done
ECHOLIST=($(echo "${ECHOLIST[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
echo "dirList=${ECHOLIST[*]}" >> $GITHUB_OUTPUT
- name: Perform yarn install in changed directories
working-directory: ${{ github.workspace }}
run: |
for DIR in ${{ steps.changed-dirs.outputs.dirList }}
do
echo "Yarn install in $DIR"
echo $(pwd)
cd "$DIR" && yarn install --immutable && cd ${{ github.workspace }}
done