From eed5dd90f008dc56a66e7fa951f2890020c18573 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Wed, 23 Sep 2020 14:05:28 -0230 Subject: [PATCH] Update GitHub CI workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change updates the GitHub Action workflow used for CI, adding names to the jobs as well as a terminal job that will simplify the process of adding required status checks to branches. Having a known terminal job that is consistent across all projects makes it easy to add a required status check for a branch—one that will not change as new intermediate jobs are added. A lint task and the appropriate `yarn` flags have been added as well. --- .github/workflows/build-test.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/node.js.yml | 29 ----------------------------- package.json | 2 +- 3 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/build-test.yml delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..408cd13 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,32 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Build & test + runs-on: ubuntu-20.04 + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn --frozen-lockfile --ignore-scripts + - run: yarn build + - run: yarn lint + - run: yarn test + all-jobs-pass: + name: All jobs pass + runs-on: ubuntu-20.04 + needs: + - build + steps: + - uses: actions/checkout@v2 diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 2f0a38a..0000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,29 +0,0 @@ -# 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 - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn - - run: npm run build --if-present - - run: npm test diff --git a/package.json b/package.json index e57aa6b..9b0fb26 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test": "jest", "test:watch": "jest --watch", "prepublishOnly": "npm run build", - "lint": "eslint --ext .ts,.js .", + "lint": "printf '%s\n' 'No lint command yet'", "build": "rollup --config" }, "license": "MIT",