14
14
pull_request :
15
15
branches :
16
16
- ' **'
17
-
17
+
18
18
env :
19
- CODECOV_UNIQUE_NAME : CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}
20
-
19
+ CODECOV_UNIQUE_NAME : CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}
20
+
21
21
jobs :
22
22
Code-Quality-Checks :
23
23
name : Check for linting, formatting, and type errors
@@ -26,18 +26,33 @@ jobs:
26
26
- name : Checkout repository content
27
27
uses : actions/checkout@v3
28
28
29
+ - name : Restore node_modules from cache
30
+ id : cache-npm
31
+ uses : actions/cache@v3
32
+ env :
33
+ cache-name : cache-node-modules
34
+ with :
35
+ path : |
36
+ ~/.npm
37
+ node_modules
38
+ key : ${{ runner.os }}-code-quality-checks-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
39
+ restore-keys : |
40
+ ${{ runner.os }}-code-quality-checks-${{ env.cache-name }}-
41
+ ${{ runner.os }}-code-quality-checks-
42
+ ${{ runner.os }}-
43
+
29
44
- name : Install Dependencies
30
45
run : npm ci
31
-
46
+
32
47
- name : Run ESLint to check for linting errors
33
48
run : npm run lint:check
34
-
49
+
35
50
- name : Check for formatting errors
36
51
run : npm run format:check
37
-
52
+
38
53
- name : Run Typescript Type-Checker
39
54
run : npm run typecheck
40
-
55
+
41
56
Test-Application :
42
57
name : Testing Application
43
58
runs-on : ubuntu-latest
@@ -68,16 +83,16 @@ jobs:
68
83
MONGO_DB_URL : mongodb://localhost:27017/talawa-test-db
69
84
REDIS_HOST : localhost
70
85
REDIS_PORT : 6379
71
- # ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
72
- # REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}
86
+ # ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
87
+ # REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}
73
88
74
89
steps :
75
90
- name : Checkout repository
76
91
uses : actions/checkout@v3
77
-
92
+
78
93
- name : Generate Access Token Secret
79
94
run : echo "ACCESS_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
80
-
95
+
81
96
- name : Generate Refresh Token Secret
82
97
run : echo "REFRESH_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
83
98
@@ -100,7 +115,7 @@ jobs:
100
115
with :
101
116
verbose : true
102
117
fail_ci_if_error : false
103
- name : ' ${{env.CODECOV_UNIQUE_NAME}}'
118
+ name : ' ${{env.CODECOV_UNIQUE_NAME}}'
104
119
105
120
- name : Test acceptable level of code coverage
106
121
uses : VeryGoodOpenSource/very_good_coverage@v2
@@ -123,4 +138,3 @@ jobs:
123
138
if : env.RUN_JSDOCS == 'True'
124
139
run : echo "Run JSdocs :${{ env.RUN_JSDOCS }}"
125
140
126
-
0 commit comments