@@ -21,14 +21,11 @@ jobs:
21
21
uses : actions/setup-node@v2-beta
22
22
with :
23
23
node-version : ' 14'
24
- - name : Get cache directory
25
- id : yarn-cache-dir-path
26
- run : echo "::set-output name=dir::$(yarn cache dir)"
27
24
- name : Use yarn cache
28
25
uses : actions/cache@v2
29
26
with :
30
27
path : |
31
- ${{ steps.yarn-cache-dir-path.outputs.dir }}
28
+ ./node_modules
32
29
~/.npm-packages-offline-cache
33
30
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34
31
restore-keys : |
37
34
- name : Install deps
38
35
run : |
39
36
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
40
- yarn config set yarn-offline-mirror-pruning true
41
37
yarn install --frozen-lockfile --prefer-offline
42
38
- name : Build
43
39
id : yarn-pack-dir
46
42
uses : actions/upload-artifact@v2
47
43
with :
48
44
name : angularfire-${{ github.run_id }}
49
- path : |
50
- angularfire.tgz
51
- publish.sh
52
- unpack.sh
45
+ path : dist
53
46
retention-days : 1
54
47
test :
55
48
runs-on : ubuntu-latest
@@ -66,14 +59,11 @@ jobs:
66
59
with :
67
60
node-version : ${{ matrix.node }}
68
61
check-latest : true
69
- - name : Get cache directory
70
- id : yarn-cache-dir-path
71
- run : echo "::set-output name=dir::$(yarn cache dir)"
72
62
- name : Use yarn cache
73
63
uses : actions/cache@v2
74
64
with :
75
65
path : |
76
- ${{ steps.yarn-cache-dir-path.outputs.dir }}
66
+ ./node_modules
77
67
~/.npm-packages-offline-cache
78
68
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
79
69
restore-keys : |
@@ -91,17 +81,52 @@ jobs:
91
81
yarn install --frozen-lockfile --prefer-offline
92
82
- name : ' Download Artifacts'
93
83
uses : actions/download-artifact@v2
94
- - name : Expand Artifact
84
+ - name : Run tests
95
85
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
99
122
- name : Run tests
100
- run : yarn test:all
123
+ run : |
124
+ mv angularfire-${{ github.run_id }} dist
125
+ yarn test:chrome-headless
101
126
publish :
102
127
runs-on : ubuntu-latest
103
128
name : Publish (NPM)
104
- needs : test
129
+ needs : [' test', 'headless']
105
130
if : ${{ github.ref == 'refs/heads/master' || github.event_name == 'release' }}
106
131
steps :
107
132
- name : Setup node
@@ -113,7 +138,7 @@ jobs:
113
138
uses : actions/download-artifact@v2
114
139
- name : Publish
115
140
run : |
116
- cd ./angularfire-${{ github.run_id }}/
141
+ cd ./angularfire-${{ github.run_id }}/packages-dist
117
142
chmod +x publish.sh
118
143
./publish.sh
119
144
env :
0 commit comments