Skip to content

Commit 5256c0d

Browse files
authored
Merge pull request #1 from rchougule/master
BrowserStack GitHub Actions - Initial Release
2 parents 99c9056 + b6d0d6b commit 5256c0d

37 files changed

+32986
-2
lines changed

.github/workflows/setup-env.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'unit tests: setting test env for BrowserStack'
2+
on:
3+
pull_request:
4+
paths:
5+
- 'setup-env/**'
6+
- '.github/workflows/setup-env*'
7+
push:
8+
paths:
9+
- 'setup-env/**'
10+
- '.github/workflows/setup-env*'
11+
12+
13+
jobs:
14+
unit-tests:
15+
runs-on: ${{ matrix.operating-system }}
16+
strategy:
17+
matrix:
18+
operating-system: [ubuntu-latest, macos-latest, windows-latest]
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set Node.js 12.x
23+
uses: actions/setup-node@master
24+
with:
25+
node-version: 12.x
26+
27+
- name: npm install
28+
working-directory: ./setup-env
29+
run: npm install
30+
31+
- name: Lint and Unit tests
32+
working-directory: ./setup-env
33+
run: npm run test

.github/workflows/setup-local.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'unit tests: setting local binary for BrowserStack'
2+
on:
3+
pull_request:
4+
paths:
5+
- 'setup-local/**'
6+
- '.github/workflows/setup-local*'
7+
push:
8+
paths:
9+
- 'setup-local/**'
10+
- '.github/workflows/setup-local*'
11+
12+
13+
jobs:
14+
unit-tests:
15+
runs-on: ${{ matrix.operating-system }}
16+
strategy:
17+
matrix:
18+
operating-system: [ubuntu-latest, macos-latest, windows-latest]
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set Node.js 12.x
23+
uses: actions/setup-node@master
24+
with:
25+
node-version: 12.x
26+
27+
- name: npm install
28+
working-directory: ./setup-local
29+
run: npm install
30+
31+
- name: Lint and Unit tests
32+
working-directory: ./setup-local
33+
run: npm run test

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 BrowserStack
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# github-actions
2-
A collection of GitHub Actions for BrowserStack. For internal reference: https://browserstack.atlassian.net/wiki/spaces/ENG/pages/1750928573/GitHub+Integration+via+GitHub+Actions
1+
BrowserStack Actions
2+
3+
1. Setup Test Environment: [Readme](./setup-env/README.md)
4+
2. Local Binary Setup: [Readme](./setup-local/README.md)

action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'BrowserStack Actions'
2+
description: 'Setup BrowserStack Test Environment'
3+
inputs:
4+
username:
5+
description: 'BrowserStack Username'
6+
required: true
7+
access-key:
8+
description: 'BrowserStack Access Key'
9+
required: true
10+
build-name:
11+
description: 'Build name for the tests'
12+
required: false
13+
project-name:
14+
description: 'Project name for the tests'
15+
required: false
16+
runs:
17+
using: 'node12'
18+
main: 'setup-env/dist/index.js'

setup-env/.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
es2020: true,
5+
mocha: true,
6+
},
7+
extends: 'airbnb-base',
8+
parserOptions: {
9+
ecmaVersion: 11,
10+
sourceType: 'script',
11+
},
12+
rules: {
13+
semi: ['error', 'always'],
14+
indent: ['error', 2, { SwitchCase: 1 }],
15+
quotes: 'off',
16+
'consistent-return': 'off',
17+
'no-underscore-dangle': 'off',
18+
'no-case-declarations': 'error',
19+
'prefer-destructuring': ['error', { object: true, array: false }],
20+
'no-restricted-syntax': 'off',
21+
'linebreak-style': 'off',
22+
},
23+
ignorePatterns: ['dist/index.js'],
24+
};

setup-env/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
coverage
3+
.nyc_output

setup-env/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README for Setup BrowserStack Test Environment

setup-env/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'setup-env'
2+
description: 'Setup BrowserStack Test Environment'
3+
inputs:
4+
username:
5+
description: 'BrowserStack Username'
6+
required: true
7+
access-key:
8+
description: 'BrowserStack Access Key'
9+
required: true
10+
build-name:
11+
description: 'Build name for the tests'
12+
required: false
13+
project-name:
14+
description: 'Project name for the tests'
15+
required: false
16+
runs:
17+
using: 'node12'
18+
main: 'dist/index.js'

setup-env/config/constants.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
INPUT: {
3+
USERNAME: 'username',
4+
ACCESS_KEY: 'access-key',
5+
BUILD_NAME: 'build-name',
6+
PROJECT_NAME: 'project-name',
7+
},
8+
9+
ENV_VARS: {
10+
BROWSERSTACK_USERNAME: 'BROWSERSTACK_USERNAME',
11+
BROWSERSTACK_ACCESS_KEY: 'BROWSERSTACK_ACCESS_KEY',
12+
BROWSERSTACK_BUILD_NAME: 'BROWSERSTACK_BUILD_NAME',
13+
BROWSERSTACK_PROJECT_NAME: 'BROWSERSTACK_PROJECT_NAME',
14+
},
15+
};

0 commit comments

Comments
 (0)