Skip to content

Commit

Permalink
Build: Add browserstack workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Apr 12, 2021
1 parent be3a71b commit a259bfb
Show file tree
Hide file tree
Showing 6 changed files with 378 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/browsers-full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: browsers-full
on:
# Once a week on Thursday at 02:15
schedule:
- cron: '15 2 * * 4'
# Or manually
workflow_dispatch:
# Or when developing this workflow
push:
paths:
- .github/workflows/browsers-full.yaml

jobs:
run:
name: BrowserStack
runs-on: ubuntu-latest
env:
PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.npm
~/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Use Node.js 10
uses: actions/setup-node@v2
with:
node-version: 10.x

- name: Prepare
run: |
npm ci
npm run build
- name: Tests
run: npm run browserstack
env:
BROWSERSTACK_JSON: build/browserstack-full.json
BROWSERSTACK_USERNAME: "${{ secrets.BROWSERSTACK_USERNAME }}"
BROWSERSTACK_KEY: "${{ secrets.BROWSERSTACK_KEY }}"
# Set "project" metadata
TRAVIS_REPO_SLUG: "${{ github.repository }} ${{ github.event_name }}"
# Set "commit" metadata
TRAVIS_COMMIT: "full ${{ github.ref }} ${{ github.sha }}"
TUNNEL_ID: "${{ github.event_name }}-full-${{ github.sha }}"
45 changes: 45 additions & 0 deletions .github/workflows/browsers-quick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: browsers-quick
on:
pull_request:
# Or when developing this workflow
push:
paths:
- .github/workflows/browsers-quick.yaml

jobs:
run:
name: BrowserStack
runs-on: ubuntu-latest
env:
PUPPETEER_DOWNLOAD_PATH: ~/.puppeteer_download
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.npm
~/.puppeteer_download
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Use Node.js 10
uses: actions/setup-node@v2
with:
node-version: 10.x

- name: Prepare
run: |
npm ci
npm run build
- name: Tests
run: npm run browserstack
env:
BROWSERSTACK_JSON: build/browserstack-quick.json
BROWSERSTACK_USERNAME: "${{ secrets.BROWSERSTACK_USERNAME }}"
BROWSERSTACK_KEY: "${{ secrets.BROWSERSTACK_KEY }}"
# Set "project" metadata
TRAVIS_REPO_SLUG: "${{ github.repository }} ${{ github.event_name}}"
# Set "commit" metadata
TRAVIS_COMMIT: "quick ${{ github.ref }} ${{ github.sha }}"
TUNNEL_ID: "${{ github.event_name }}-quick-${{ github.sha }}"
101 changes: 101 additions & 0 deletions build/browserstack-full.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"test_framework": "qunit",
"test_path": ["test/index.html"],
"test_server_port": "8899",
"exit_with_fail": true,
"timeout": 600,
"browsers": [
"firefox_45",
"firefox_78",
"firefox_previous",
"firefox_current",
"ie_9",
"ie_10",
"ie_11",
"edge_15",
"edge_18",
"edge_previous",
"edge_current",
"safari_9.1",
"safari_10.1",
"safari_11.1",
"safari_12.1",
"safari_13.1",
"safari_current",
"opera_36",
"opera_previous",
"opera_current",
"chrome_58",
"chrome_previous",
"chrome_current",
{
"device": "Samsung Galaxy S20",
"real_mobile": true,
"os": "android",
"os_version": "10.0"
},
{
"device": null,
"os": "ios",
"os_version": "7"
},
{
"device": null,
"os": "ios",
"os_version": "8"
},
{
"device": null,
"os": "ios",
"os_version": "9"
},
{
"device": null,
"os": "ios",
"os_version": "10"
},
{
"device": "iPhone SE",
"real_mobile": true,
"os": "ios",
"os_version": "11"
},
{
"device": "iPhone XR",
"real_mobile": true,
"os": "ios",
"os_version": "12"
}
],
"@browsers_broken": [
{
"@ref": [
"https://github.com/browserstack/browserstack-runner/issues/245",
"Android 4, Android 5, Android 6"
]
},
{
"@ref": [
"https://github.com/browserstack/browserstack-runner/issues/226",
"Android 7-10",
"iOS 13, 14"
]
},
{
"device": "Samsung Galaxy S7",
"real_mobile": true,
"os": "android",
"os_version": "6.0"
},
{
"device": null,
"os": "ios",
"os_version": "13"
},
{
"device": null,
"os": "ios",
"os_version": "14"
}
]
}
28 changes: 28 additions & 0 deletions build/browserstack-quick.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"test_framework": "qunit",
"test_path": ["test/index.html"],
"test_server_port": "8899",
"exit_with_fail": true,
"timeout": 600,
"browsers": [
"firefox_45",
"firefox_current",
"ie_9",
"safari_9.1",
"safari_current",
"opera_current",
"chrome_current",
{
"device": "Samsung Galaxy S20",
"real_mobile": true,
"os": "android",
"os_version": "10.0"
},
{
"device": "iPhone SE",
"real_mobile": true,
"os": "ios",
"os_version": "11"
}
]
}
Loading

0 comments on commit a259bfb

Please sign in to comment.