Skip to content

Commit f947321

Browse files
committed
Adding Firefox and Safari tests, doubt Safari will work in actions
1 parent 6d4a022 commit f947321

File tree

4 files changed

+79
-6
lines changed

4 files changed

+79
-6
lines changed

.github/workflows/test.yml

+53-2
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ jobs:
110110
headless:
111111
runs-on: ubuntu-latest
112112
needs: build
113-
name: Test firebase@${{ matrix.firebase }} on Headless Chrome
113+
name: Test firebase@${{ matrix.firebase }} on ${{ matrix.browser }}
114114
strategy:
115115
matrix:
116116
firebase: ["beta"]
117+
browser: ["chrome", "firefox"]
117118
fail-fast: false
118119
steps:
119120
- name: Checkout
@@ -155,7 +156,57 @@ jobs:
155156
- name: Run tests
156157
run: |
157158
mv angularfire-${{ github.run_id }} dist
158-
yarn test:chrome-headless
159+
yarn test:${{ matrix.browser }}-headless
160+
161+
safari:
162+
runs-on: macos-latest
163+
needs: build
164+
name: Test firebase@${{ matrix.firebase }} on safari
165+
strategy:
166+
matrix:
167+
firebase: ["beta"]
168+
fail-fast: false
169+
steps:
170+
- name: Checkout
171+
uses: actions/checkout@v2
172+
- name: Setup node
173+
uses: actions/setup-node@v2-beta
174+
with:
175+
node-version: '14'
176+
check-latest: true
177+
- name: node_modules cache
178+
id: node_modules_cache
179+
uses: actions/cache@v2
180+
with:
181+
path: ./node_modules
182+
key: ${{ runner.os }}-14-${{ matrix.firebase }}-node_modules-${{ hashFiles('yarn.lock') }}
183+
restore-keys: |
184+
${{ runner.os }}-14-${{ matrix.firebase }}-node_modules-
185+
${{ runner.os }}-14-node_modules-
186+
- name: Yarn offline cache
187+
if: steps.node_modules_cache.outputs.cache-hit != 'true'
188+
uses: actions/cache@v2
189+
with:
190+
path: ~/.npm-packages-offline-cache
191+
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
192+
restore-keys: yarn-offline
193+
- name: Install deps
194+
if: steps.node_modules_cache.outputs.cache-hit != 'true'
195+
run: |
196+
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
197+
yarn install --frozen-lockfile --prefer-offline
198+
yarn add firebase@${{ matrix.firebase }} --prefer-offline
199+
- name: Firebase emulator cache
200+
uses: actions/cache@v2
201+
with:
202+
path: ~/.cache/firebase/emulators
203+
key: firebase_emulators
204+
- name: 'Download Artifacts'
205+
uses: actions/download-artifact@v2
206+
- name: Run tests
207+
run: |
208+
mv angularfire-${{ github.run_id }} dist
209+
yarn test:safari
159210
160211
publish:
161212
runs-on: ubuntu-latest

karma.conf.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ module.exports = function (config) {
77
plugins: [
88
require('karma-jasmine'),
99
require('karma-chrome-launcher'),
10+
require('karma-safari-launcher'),
11+
require('karma-firefox-launcher'),
1012
require('karma-jasmine-html-reporter'),
1113
require('karma-coverage-istanbul-reporter'),
1214
require('@angular-devkit/build-angular/plugins/karma')
@@ -24,13 +26,15 @@ module.exports = function (config) {
2426
colors: true,
2527
logLevel: config.LOG_INFO,
2628
autoWatch: true,
27-
browsers: ['Chrome', 'ChromeHeadless'],
29+
browsers: ['Chrome', 'ChromeHeadless', 'Safari', 'Firefox', 'FirefoxHeadless'],
2830
singleRun: false,
2931
restartOnFileChange: true,
3032
customLaunchers: {
31-
ChromeHeadlessTravis: {
32-
base: 'ChromeHeadless',
33-
flags: ['--no-sandbox']
33+
FirefoxHeadless: {
34+
base: 'Firefox',
35+
flags: [
36+
'-headless',
37+
],
3438
}
3539
},
3640
});

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"test": "npm run build:jasmine && npm run test:node && npm run test:chrome-headless",
88
"test:watch": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=true --browsers=Chrome\"",
99
"test:chrome": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Chrome\"",
10+
"test:firefox": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Firefox\"",
11+
"test:safari": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Safari\"",
1012
"test:chrome-headless": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=ChromeHeadless\"",
13+
"test:firefox-headless": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=FirefoxHeadless\"",
1114
"lint": "ng lint",
1215
"test:node": "node -r tsconfig-paths/register ./tools/jasmine.js",
1316
"test:typings": "node ./tools/run-typings-test.js",
@@ -98,8 +101,10 @@
98101
"karma": "~5.0.0",
99102
"karma-chrome-launcher": "~3.1.0",
100103
"karma-coverage-istanbul-reporter": "~3.0.2",
104+
"karma-firefox-launcher": "^2.1.0",
101105
"karma-jasmine": "~4.0.0",
102106
"karma-jasmine-html-reporter": "^1.5.0",
107+
"karma-safari-launcher": "^1.0.0",
103108
"ncp": "^2.0.0",
104109
"ng-packagr": "^10.1.0",
105110
"pretty-size": "^2.0.0",

yarn.lock

+13
Original file line numberDiff line numberDiff line change
@@ -8325,6 +8325,14 @@ karma-coverage-istanbul-reporter@~3.0.2:
83258325
istanbul-reports "^3.0.2"
83268326
minimatch "^3.0.4"
83278327

8328+
karma-firefox-launcher@^2.1.0:
8329+
version "2.1.0"
8330+
resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-2.1.0.tgz#d0d328c93dfcf9b46f1ac83b4bb32f43aadb2050"
8331+
integrity sha512-dkiyqN2R6fCWt78rciOXJLFDWcQ7QEQi++HgebPJlw1y0ycDjGNDHuSrhdh48QG02fzZKK20WHFWVyBZ6CPngg==
8332+
dependencies:
8333+
is-wsl "^2.2.0"
8334+
which "^2.0.1"
8335+
83288336
karma-jasmine-html-reporter@^1.5.0:
83298337
version "1.5.4"
83308338
resolved "https://registry.yarnpkg.com/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-1.5.4.tgz#669f33d694d88fce1b0ccfda57111de716cb0192"
@@ -8337,6 +8345,11 @@ karma-jasmine@~4.0.0:
83378345
dependencies:
83388346
jasmine-core "^3.6.0"
83398347

8348+
karma-safari-launcher@^1.0.0:
8349+
version "1.0.0"
8350+
resolved "https://registry.yarnpkg.com/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz#96982a2cc47d066aae71c553babb28319115a2ce"
8351+
integrity sha1-lpgqLMR9BmquccVTursoMZEVos4=
8352+
83408353
83418354
version "1.4.0"
83428355
resolved "https://registry.yarnpkg.com/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz#58526ceccf7e8730e56effd97a4de8d712ac0d6b"

0 commit comments

Comments
 (0)