-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
62 lines (59 loc) · 1.66 KB
/
yarn-validation.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
name: Yarn validation
env:
YARN_ENABLE_HARDENED_MODE: 1
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-reanimated'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- name: Install monorepo dependencies
run: yarn install
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
**/package.json
**/yarn.lock
- 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