Skip to content

Commit

Permalink
ci: Add test workflow (#32)
Browse files Browse the repository at this point in the history
Although there aren't any real tests (see #31), we can run the linter
on new PRs.  When we add tests later, the workflow will activate them
through npm test.
  • Loading branch information
joeyparrish committed Feb 14, 2022
1 parent f7a4572 commit a40257e
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: test
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build and Lint on ${{ matrix.os }}, Node.js ${{ matrix.node-version }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
# Oldest supported LTS version through current LTS
node-version: [12.x, 14.x, 16.x]
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Deps
run: npm ci
- name: Build Selenium DriverProvider JAR
run: npm run jar
- name: Test all packages
shell: bash
run: |
npm test
for i in backends/*/; do
pushd "$i"
npm test
popd
done
2 changes: 1 addition & 1 deletion backends/chromecast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"lint": "(cd ../../; npx eslint --ignore-path .gitignore --max-warnings 0 backends/chromecast/)",
"checkClean": "[[ -z \"$(git status --short .)\" ]] || (echo \"Git not clean!\"; git status .; exit 1)",
"pretest": "npm run lint",
"test": "npm run lint",
"prepack": "npm run lint && npm run checkClean"
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion backends/chromeos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": {
"lint": "(cd ../../; npx eslint --ignore-path .gitignore --max-warnings 0 backends/chromeos/)",
"checkClean": "[[ -z \"$(git status --short .)\" ]] || (echo \"Git not clean!\"; git status .; exit 1)",
"pretest": "npm run lint",
"test": "npm run lint",
"prepack": "npm run lint && npm run checkClean"
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion backends/fake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"scripts": {
"lint": "(cd ../../; npx eslint --ignore-path .gitignore --max-warnings 0 backends/fake/)",
"checkClean": "[[ -z \"$(git status --short .)\" ]] || (echo \"Git not clean!\"; git status .; exit 1)",
"pretest": "npm run lint",
"test": "npm run lint",
"prepack": "npm run lint && npm run checkClean"
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion backends/tizen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"lint": "(cd ../../; npx eslint --ignore-path .gitignore --max-warnings 0 backends/tizen/)",
"checkClean": "[[ -z \"$(git status --short .)\" ]] || (echo \"Git not clean!\"; git status .; exit 1)",
"pretest": "npm run lint",
"test": "npm run lint",
"prepack": "npm run lint && npm run checkClean"
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion backends/xboxone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"lint": "(cd ../../; npx eslint --ignore-path .gitignore --max-warnings 0 backends/xboxone/)",
"checkClean": "[[ -z \"$(git status --short .)\" ]] || (echo \"Git not clean!\"; git status .; exit 1)",
"pretest": "npm run lint",
"test": "npm run lint",
"prepack": "npm run lint && npm run checkClean"
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint": "eslint --ignore-path .gitignore --max-warnings 0 .",
"jar": "ant -f java/build.xml jar && cp java/build/jar/*.jar java/third_party/selenium*.jar ./",
"checkClean": "[[ -z \"$(git status --short .)\" ]] || (echo \"Git not clean!\"; git status .; exit 1)",
"pretest": "npm run lint",
"test": "npm run lint",
"prepack": "npm run lint && npm run checkClean && npm run jar"
},
"dependencies": {
Expand Down

0 comments on commit a40257e

Please sign in to comment.