@@ -21,14 +21,11 @@ jobs:
2121 uses : actions/setup-node@v2-beta
2222 with :
2323 node-version : ' 14'
24- - name : Get cache directory
25- id : yarn-cache-dir-path
26- run : echo "::set-output name=dir::$(yarn cache dir)"
2724 - name : Use yarn cache
2825 uses : actions/cache@v2
2926 with :
3027 path : |
31- ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+ ./node_modules
3229 ~/.npm-packages-offline-cache
3330 key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
3431 restore-keys : |
3734 - name : Install deps
3835 run : |
3936 yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
40- yarn config set yarn-offline-mirror-pruning true
4137 yarn install --frozen-lockfile --prefer-offline
4238 - name : Build
4339 id : yarn-pack-dir
4642 uses : actions/upload-artifact@v2
4743 with :
4844 name : angularfire-${{ github.run_id }}
49- path : |
50- angularfire.tgz
51- publish.sh
52- unpack.sh
45+ path : dist
5346 retention-days : 1
5447 test :
5548 runs-on : ubuntu-latest
@@ -66,14 +59,11 @@ jobs:
6659 with :
6760 node-version : ${{ matrix.node }}
6861 check-latest : true
69- - name : Get cache directory
70- id : yarn-cache-dir-path
71- run : echo "::set-output name=dir::$(yarn cache dir)"
7262 - name : Use yarn cache
7363 uses : actions/cache@v2
7464 with :
7565 path : |
76- ${{ steps.yarn-cache-dir-path.outputs.dir }}
66+ ./node_modules
7767 ~/.npm-packages-offline-cache
7868 key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
7969 restore-keys : |
@@ -91,17 +81,52 @@ jobs:
9181 yarn install --frozen-lockfile --prefer-offline
9282 - name : ' Download Artifacts'
9383 uses : actions/download-artifact@v2
94- - name : Expand Artifact
84+ - name : Run tests
9585 run : |
96- mkdir -p dist/packages-dist
97- chmod +x angularfire-${{ github.run_id }}/unpack.sh
98- ./angularfire-${{ github.run_id }}/unpack.sh
86+ mv angularfire-${{ github.run_id }} dist
87+ yarn test:node
88+ headless :
89+ runs-on : ubuntu-latest
90+ needs : build
91+ name : Test Headless Chrome (Ubuntu)
92+ steps :
93+ - name : Checkout
94+ uses : actions/checkout@v2
95+ - name : Setup node
96+ uses : actions/setup-node@v2-beta
97+ with :
98+ node-version : ' 14'
99+ check-latest : true
100+ - name : Use yarn cache
101+ uses : actions/cache@v2
102+ with :
103+ path : |
104+ ./node_modules
105+ ~/.npm-packages-offline-cache
106+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
107+ restore-keys : |
108+ ${{ runner.os }}-yarn-
109+ ${{ runner.os }}-
110+ - name : Use Firebase emulator cache
111+ uses : actions/cache@v2
112+ with :
113+ path : ~/.cache/firebase/emulators
114+ key : firebase_emulators
115+ - name : Install deps
116+ run : |
117+ yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
118+ yarn config set yarn-offline-mirror-pruning true
119+ yarn install --frozen-lockfile --prefer-offline
120+ - name : ' Download Artifacts'
121+ uses : actions/download-artifact@v2
99122 - name : Run tests
100- run : yarn test:all
123+ run : |
124+ mv angularfire-${{ github.run_id }} dist
125+ yarn test:chrome-headless
101126 publish :
102127 runs-on : ubuntu-latest
103128 name : Publish (NPM)
104- needs : test
129+ needs : [' test', 'headless']
105130 if : ${{ github.ref == 'refs/heads/master' || github.event_name == 'release' }}
106131 steps :
107132 - name : Setup node
@@ -113,7 +138,7 @@ jobs:
113138 uses : actions/download-artifact@v2
114139 - name : Publish
115140 run : |
116- cd ./angularfire-${{ github.run_id }}/
141+ cd ./angularfire-${{ github.run_id }}/packages-dist
117142 chmod +x publish.sh
118143 ./publish.sh
119144 env :
0 commit comments