diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..762767f --- /dev/null +++ b/.github/workflows/test.yaml @@ -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 diff --git a/backends/chromecast/package.json b/backends/chromecast/package.json index e98ed2d..ea66d95 100644 --- a/backends/chromecast/package.json +++ b/backends/chromecast/package.json @@ -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": { diff --git a/backends/chromeos/package.json b/backends/chromeos/package.json index fff6628..24d5f60 100644 --- a/backends/chromeos/package.json +++ b/backends/chromeos/package.json @@ -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": { diff --git a/backends/fake/package.json b/backends/fake/package.json index ca58f31..7ee5c98 100644 --- a/backends/fake/package.json +++ b/backends/fake/package.json @@ -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": { diff --git a/backends/tizen/package.json b/backends/tizen/package.json index a1a6146..b79a6a4 100644 --- a/backends/tizen/package.json +++ b/backends/tizen/package.json @@ -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": { diff --git a/backends/xboxone/package.json b/backends/xboxone/package.json index f26308c..451c12d 100644 --- a/backends/xboxone/package.json +++ b/backends/xboxone/package.json @@ -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": { diff --git a/package.json b/package.json index b393334..57819a4 100644 --- a/package.json +++ b/package.json @@ -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": {