From c653d2cf3b0e36766522180dee5448d1591dc781 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Wed, 9 Mar 2022 15:10:02 -0800 Subject: [PATCH] chore: lint the code once per build action Previously, every version of Node.js would run eslint, which is redundant --- .github/workflows/{node.js.yml => build.yml} | 37 +++++++++++++------- package.json | 2 ++ 2 files changed, 26 insertions(+), 13 deletions(-) rename .github/workflows/{node.js.yml => build.yml} (59%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/build.yml similarity index 59% rename from .github/workflows/node.js.yml rename to .github/workflows/build.yml index 367203797..06d958899 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,13 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Appium Build on: [push, pull_request] jobs: - build: + test: + name: Test runs-on: ubuntu-latest - strategy: matrix: node-version: [12.x, 14.x, 16.x] @@ -23,18 +23,29 @@ jobs: - name: Install dependencies run: npm install - name: Run unit tests - run: npm test + run: npm run test:ci + - name: Install @appium/fake-driver + run: npm run install-fake-driver - name: Run E2E tests - run: | - npm run install-fake-driver - npm run e2e-test + run: npm run e2e-test - generate_docs: - needs: [build] + lint: + name: Lint runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - - run: | - npm install - npm run generate-docs + - name: Install dependencies + run: npm install + - name: ESLint + run: npm run lint + + docs: + name: Build Command Documentation + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: npm install + - name: Generate docs + run: npm run generate-docs diff --git a/package.json b/package.json index 267238d4b..5b9770835 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,8 @@ "test": "lerna run test", "test:appium": "lerna run --scope=appium test", "test:base-driver": "lerna run --scope=@appium/base-driver test", + "pretest:ci": "npm run build", + "test:ci": "lerna run test", "test:doctor": "lerna run --scope=@appium/doctor test", "test:e2e:appium": "lerna run --scope=appium test:e2e", "test:e2e:base-driver": "lerna run --scope=@appium/base-driver test:e2e",