Commit 627814c authored Jul 12, 2024 · 10 / 10 · Verified
File tree 4 files changed +174
-10
lines changed
4 files changed +174
-10
lines changed Original file line number Diff line number Diff line change
1
+ name : Frontend
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ workflow_run :
6
+ workflows : ["Contract"]
7
+ types :
8
+ - completed
9
+ push :
10
+ branches : ["main", "stage"]
11
+ pull_request :
12
+ branches : ["main", "stage"]
13
+
14
+ defaults :
15
+ run :
16
+ working-directory : frontend
17
+
18
+ jobs :
19
+ lint :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Checkout Code
23
+ uses : actions/checkout@v3
24
+
25
+ - name : Set up Node.js
26
+ uses : actions/setup-node@v3
27
+ with :
28
+ node-version : 20
29
+
30
+ - name : Cache node modules
31
+ id : cache-npm
32
+ uses : actions/cache@v3
33
+ env :
34
+ cache-name : cache-npm
35
+ with :
36
+ path : ~/.npm
37
+ key : firebase-frontend-${{ runner.os }}-${{ hashFiles('frontend/package-lock.json') }}
38
+
39
+ - name : Install Dependencies
40
+ run : npm ci
41
+
42
+ - name : Lint Frontend
43
+ run : npm run lint
44
+
45
+ build :
46
+ runs-on : ubuntu-latest
47
+ needs : lint
48
+ steps :
49
+
50
+ - name : Checkout Code
51
+ uses : actions/checkout@v3
52
+
53
+ - name : Set up Node.js
54
+ uses : actions/setup-node@v3
55
+ with :
56
+ node-version : 20
57
+
58
+ - name : Cache node modules
59
+ id : cache-npm
60
+ uses : actions/cache@v3
61
+ env :
62
+ cache-name : cache-npm
63
+ with :
64
+ path : ~/.npm
65
+ key : firebase-frontend-${{ runner.os }}-${{ hashFiles('frontend/package-lock.json') }}
66
+
67
+ - name : Install Dependencies
68
+ run : npm ci
69
+
70
+ - name : Build Frontend
71
+ run : npm run build --if-present
Original file line number Diff line number Diff line change
1
+ name : Functions
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ workflow_run :
6
+ workflows : ["Contract"]
7
+ types :
8
+ - completed
9
+ push :
10
+ branches : ["main", "stage"]
11
+ pull_request :
12
+ branches : ["main", "stage"]
13
+
14
+ defaults :
15
+ run :
16
+ working-directory : functions
17
+
18
+ jobs :
19
+ lint :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Checkout Code
23
+ uses : actions/checkout@v3
24
+
25
+ - name : Set up Node.js
26
+ uses : actions/setup-node@v3
27
+ with :
28
+ node-version : 20
29
+
30
+ - name : Cache node modules
31
+ id : cache-npm
32
+ uses : actions/cache@v3
33
+ env :
34
+ cache-name : cache-npm
35
+ with :
36
+ path : ~/.npm
37
+ key : firebase-functions-${{ runner.os }}-${{ hashFiles('functions/package-lock.json') }}
38
+
39
+ - name : Install Dependencies
40
+ run : npm ci
41
+
42
+ - name : Lint functions
43
+ run : npm run lint
44
+
45
+ build :
46
+ runs-on : ubuntu-latest
47
+ needs : lint
48
+ steps :
49
+
50
+ - name : Checkout Code
51
+ uses : actions/checkout@v3
52
+
53
+ - name : Set up Node.js
54
+ uses : actions/setup-node@v3
55
+ with :
56
+ node-version : 20
57
+
58
+ - name : Cache node modules
59
+ id : cache-npm
60
+ uses : actions/cache@v3
61
+ env :
62
+ cache-name : cache-npm
63
+ with :
64
+ path : ~/.npm
65
+ key : firebase-functions-${{ runner.os }}-${{ hashFiles('functions/package-lock.json') }}
66
+
67
+ - name : Install Dependencies
68
+ run : npm ci
69
+
70
+ - name : Build Functions
71
+ run : npm run build --if-present
Original file line number Diff line number Diff line change
1
+ name : Contract
2
+
3
+ on :
4
+ push :
5
+ branches : ["main", "stage"]
6
+ pull_request :
7
+ branches : ["main", "stage"]
8
+
9
+ jobs :
10
+ check-contracts :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout repository
15
+ uses : actions/checkout@v3
16
+
17
+ - name : Setup Node.js
18
+ uses : actions/setup-node@v3
19
+ with :
20
+ node-version : ' 20'
21
+
22
+ - name : Verify frontend contracts folder
23
+ run : |
24
+ diff -r --exclude=node_modules --exclude=.eslintrc.js --exclude=.gitignore --exclude=package-lock.json --exclude=package.json --exclude=tsconfig.json contracts frontend/src/contracts || exit 1
25
+
26
+ - name : Verify functions contracts folder
27
+ run : |
28
+ diff -r --exclude=node_modules --exclude=.eslintrc.js --exclude=.gitignore --exclude=package-lock.json --exclude=package.json --exclude=tsconfig.json contracts functions/src/contracts || exit 1
Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
3
- rem Creating target directory if not exists
3
+ rem Creating target directories if they don't exist
4
4
mkdir frontend\src\contracts
5
5
mkdir functions\src\contracts
6
6
7
- rem Loop through directories in contracts folder and copy them to frontend\src\contracts
7
+ rem Loop through directories in contracts folder and copy them to target directories, excluding node_modules
8
8
for /D %%i in (contracts\*) do (
9
- if not " %%i " == " contracts\ node_modules" (
9
+ if /I not " %%~nxi " == " node_modules" (
10
10
robocopy " %%i " " frontend\src\contracts\%%~nxi " /E > nul
11
- )
12
- )
13
-
14
- rem Loop through directories in contracts folder and copy them to functions\src\contracts
15
- for /D %%i in (contracts\*) do (
16
- if not " %%i " == " contracts\node_modules" (
17
11
robocopy " %%i " " functions\src\contracts\%%~nxi " /E > nul
18
12
)
19
- )
13
+ )
You can’t perform that action at this time.
0 commit comments