Skip to content

Commit

Permalink
Browsertests (#59)
Browse files Browse the repository at this point in the history
* firefox tests

* chrome tests

* test

* old chromium

* chrome test

* chromium

* chrome

* old chromium

* older versions

* codecov remove

* safari

* Safari

* browsers

* polyfills

* polyfill

* polyfill

* package update

* needs
  • Loading branch information
laliconfigcat authored Jun 1, 2022
1 parent f47628e commit 3df5ed7
Show file tree
Hide file tree
Showing 8 changed files with 327 additions and 28 deletions.
129 changes: 113 additions & 16 deletions .github/workflows/js-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,44 @@ name: JS CI

on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
push:
branches: [ master ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
branches: [master]
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches: [ master ]
branches: [master]

workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
name: Test on latest Chrome and report coverage
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14


- name: Setup chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: latest

- name: Install dependencies
run: |
npm install codecov -g
npm install
- name: Build
run: |
npm run build
npm run buildPure
- name: Coverage
run: npm run test
run: CHROME_BIN=$(which chrome) npm run test

- name: Upload coverage report
run: codecov

Expand All @@ -44,9 +50,100 @@ jobs:
with:
name: npm-package
path: configcat-js*.tgz


test-chrome:
runs-on: ubuntu-latest
strategy:
matrix:
chrome: ["beta", "stable"]
name: Chrome ${{ matrix.chrome }} test
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14

- name: Setup chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: ${{ matrix.chrome }}

- name: Install dependencies
run: |
npm install
- name: Build
run: |
npm run build
npm run buildPure
- name: Test
run: CHROME_BIN=$(which chrome) npm run test-chrome


test-chromium:
runs-on: ubuntu-latest
strategy:
matrix:
chrome: ["520847", "612434", "722278"]
name: Chromium ${{ matrix.chrome }} test
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14

- name: Setup chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: ${{ matrix.chrome }}

- name: Install dependencies
run: |
npm install
- name: Build
run: |
npm run build
npm run buildPure
- name: Test
run: CHROMIUM_BIN=$(which chrome) npm run test-chromium

test-firefox:
runs-on: ubuntu-latest
strategy:
matrix:
firefox: ["84.0", "latest-beta", "latest"]
name: Firefox ${{ matrix.firefox }} test
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 14

- name: Setup firefox
uses: browser-actions/setup-firefox@latest
with:
firefox-version: ${{ matrix.firefox }}

- name: Install dependencies
run: |
npm install
- name: Build
run: |
npm run build
npm run buildPure
- name: Test
run: npm run test-firefox

publish:
needs: test
needs: [test, test-chrome, test-chromium, test-firefox]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
Expand All @@ -55,16 +152,16 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm install

- name: Build
run: |
npm run build
npm run buildPure
- name: 🚀Publish
run: npm publish
env:
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions karma-chrome.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = function(config) {
config.set({
frameworks: ["mocha", "chai", "karma-typescript"],

files: [
"src/**/*.ts",
"test/**/*.ts"
],

preprocessors: {
"src/**/*.ts": ["karma-typescript"],
"test/**/*.ts": ["karma-typescript"]
},

reporters: ["progress"],

browsers: ["ChromeHeadless"],

singleRun: true,

karmaTypescriptConfig: {
tsconfig: "./tsconfig.karma.json",
bundlerOptions: {
transforms: [
require("karma-typescript-es6-transform")()
]
}
}
});
};
30 changes: 30 additions & 0 deletions karma-chromium.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = function(config) {
config.set({
frameworks: ["mocha", "chai", "karma-typescript"],

files: [
"src/**/*.ts",
"test/**/*.ts"
],

preprocessors: {
"src/**/*.ts": ["karma-typescript"],
"test/**/*.ts": ["karma-typescript"]
},

reporters: ["progress"],

browsers: ["ChromiumHeadless"],

singleRun: true,

karmaTypescriptConfig: {
tsconfig: "./tsconfig.karma.json",
bundlerOptions: {
transforms: [
require("karma-typescript-es6-transform")()
]
}
}
});
};
30 changes: 30 additions & 0 deletions karma-firefox.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = function (config) {
config.set({
frameworks: ["mocha", "chai", "karma-typescript"],

files: [
"src/**/*.ts",
"test/**/*.ts"
],

preprocessors: {
"src/**/*.ts": ["karma-typescript"],
"test/**/*.ts": ["karma-typescript"]
},

reporters: ["progress"],

browsers: ['FirefoxHeadless'],

singleRun: true,

karmaTypescriptConfig: {
tsconfig: "./tsconfig.karma.json",
bundlerOptions: {
transforms: [
require("karma-typescript-es6-transform")()
]
}
}
});
};
Loading

0 comments on commit 3df5ed7

Please sign in to comment.