Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 39 additions & 11 deletions .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,40 @@ on:
- main

jobs:
build:
unit-tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.16]
node-version: [22.16]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Run npm ci
run: npm ci

- name: Build project
run: npm run build

- name: Run unit tests
run: npm run test:unit
env:
CI: true
NODE_ENV: test

browserstack:
runs-on: ubuntu-latest
needs: unit-tests

strategy:
matrix:
node-version: [22.16]

steps:
- name: "BrowserStack Env Setup"
Expand All @@ -30,13 +58,10 @@ jobs:
local-logging-level: "all-logs"
local-identifier: "random"

- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
set-safe-directory: "/github/workspace"
- uses: actions/checkout@v4

- name: Prettier Action on PR
uses: creyD/prettier_action@v4.3
uses: creyD/prettier_action@v4.5
with:
prettier_options: "--write {**/*,*}.{js,hbs,html,json,md,yml,css,scss} !.github/workflows/**/* !dist/**/*"
commit_message: "Run prettier via GitHub Action"
Expand All @@ -45,15 +70,18 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Run npm ci
run: sudo npm ci
run: npm ci

- name: Build project
run: npm run build

- name: Run npm test with BrowserStack Local
run: npm run build && node ./test/index.js
- name: Run BrowserStack tests
run: node ./test/index.js
env:
CI: true
NODE_ENV: test
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16
22.16
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Just run `npm run watch` and every file will be validated and compiled on save.

The most important file of the repository is [`/src/default.js`](src/default.js)

## Unit tests

Run `npm run test:unit` to execute a small set of tests without BrowserStack.

## Device testing is sponsored by BrowserStack

We run our public script with more than [50 browsers on many different (real) devices](https://github.com/simpleanalytics/scripts/blob/main/test/helpers/get-browsers.js). We support Internet Explorer 9 (not sure who is still using that) and up. Including many mobile browsers and less common devices. We get amazing sponsorship from [BrowserStack](https://www.browserstack.com/). Thanks, BrowserStack!
Expand Down
Loading
Loading