99 name : 🧪 Test
1010 runs-on : ubuntu-latest
1111 steps :
12- - uses : actions/checkout@v4
13- - uses : actions/setup-node@v4
12+ - name : Checkout
13+ uses : actions/checkout@v4
14+
15+ - name : Install package manager (from package.json)
16+ run : |
17+ corepack enable
18+ corepack install
19+
20+ - name : Setup Node
21+ uses : actions/setup-node@v4
1422 with :
15- node-version : 20
23+ node-version-file : package.json
1624 cache : ' yarn'
17- - name : install dependencies
18- run : yarn && yarn --cwd ./functions
25+
26+ - name : Install deps
27+ run : yarn install --immutable
28+
1929 - name : run linter
20- run : yarn lint && yarn --cwd ./functions lint
30+ run : yarn lint && yarn workspace functions lint
31+
2132 - name : run tests
22- run : yarn test && yarn --cwd ./functions test
23- # - name: Upload test results
24- # uses: actions/upload-artifact@v1
25- # with:
26- # name: Test results
27- # path: "**/artifacs"
33+ run : yarn test && yarn workspace functions test
2834
2935 build :
3036 name : 🛠 Build
3137 runs-on : ubuntu-latest
3238 steps :
33- - uses : actions/checkout@v4
34- - uses : actions/setup-node@v4
39+ - name : Checkout
40+ uses : actions/checkout@v4
41+
42+ - name : Install package manager (from package.json)
43+ run : |
44+ corepack enable
45+ corepack install
46+
47+ - name : Setup Node
48+ uses : actions/setup-node@v4
3549 with :
36- node-version : 20
50+ node-version-file : package.json
3751 cache : ' yarn'
38- - name : install dependencies
39- run : yarn && yarn --cwd ./functions
52+
53+ - name : Install deps
54+ run : yarn install --immutable
55+
4056 - name : build
41- run : yarn --cwd ./ functions build
57+ run : yarn workspace functions build
4258
4359 testDeploy :
4460 name : Test Deploy
4561 needs : [test, build]
4662 runs-on : ubuntu-latest
4763 steps :
48- - uses : actions/checkout@v4
49- - uses : actions/setup-node@v4
64+ - name : Checkout
65+ uses : actions/checkout@v4
66+
67+ - name : Install package manager (from package.json)
68+ run : |
69+ corepack enable
70+ corepack install
71+
72+ - name : Setup Node
73+ uses : actions/setup-node@v4
5074 with :
51- node-version : 20
75+ node-version-file : package.json
5276 cache : ' yarn'
53- - name : install dependencies
54- run : yarn && yarn --cwd ./functions
77+
78+ - name : Install deps
79+ run : yarn install
80+
5581 - name : Deploy test to Firebase
56- uses : w9jds/firebase-action@v13.25 .0
82+ uses : w9jds/firebase-action@v14.19 .0
5783 with :
58- args : deploy --only functions:testFunction
84+ args : help ; corepack enable ; corepack install ; firebase deploy --only functions:testFunction --force
5985 env :
6086 GCP_SA_KEY : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
6187
6288 - name : Call Test Function
6389 run : curl -f -s -S -X POST https://testfunction-wbe4ukn6tq-ey.a.run.app
6490
6591 - name : Cleanup Firebase Test
66- uses : w9jds/firebase-action@v13.25 .0
92+ uses : w9jds/firebase-action@v14.19 .0
6793 if : always()
6894 with :
69- args : functions:delete testFunction --force
95+ args : help ; corepack enable ; corepack install ; firebase functions:delete testFunction --force
7096 env :
7197 GCP_SA_KEY : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
7298
@@ -76,23 +102,34 @@ jobs:
76102 runs-on : ubuntu-latest
77103 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
78104 steps :
79- - uses : actions/checkout@v4
80- - uses : actions/setup-node@v4
105+ - name : Checkout
106+ uses : actions/checkout@v4
107+
108+ - name : Install package manager (from package.json)
109+ run : |
110+ corepack enable
111+ corepack install
112+
113+ - name : Setup Node
114+ uses : actions/setup-node@v4
81115 with :
82- node-version : 20
116+ node-version-file : package.json
83117 cache : ' yarn'
84- - name : install dependencies
85- run : yarn && yarn --cwd ./functions
118+
119+ - name : Install deps
120+ run : yarn install --immutable
121+
86122 - name : Deploy to Firebase
87- uses : w9jds/firebase-action@v13.25 .0
123+ uses : w9jds/firebase-action@v14.19 .0
88124 with :
89- args : deploy
125+ args : help ; corepack enable ; corepack install ; firebase deploy
90126 env :
91127 GCP_SA_KEY : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
128+
92129 - name : Cleanup Firebase Test
93- uses : w9jds/firebase-action@v13.25 .0
130+ uses : w9jds/firebase-action@v14.19 .0
94131 if : always()
95132 with :
96- args : functions:delete testFunction --force
133+ args : help ; corepack enable ; corepack install ; firebase functions:delete testFunction --force
97134 env :
98135 GCP_SA_KEY : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
0 commit comments