From 116f322e1a9aa5654c2b886dbde1a096cad1e83e Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Thu, 12 Oct 2023 22:09:05 +1100 Subject: [PATCH] chore(ci): github CI updates (#331) * Update ci.yml Add sensible timeouts * Update ci.yml optimise "clean install" command, for speed and log clarity. * Update ci.yml allow repository owners to manually re-run CI * Update ci.yml upgrade checkout action to v4 * Update ci.yml Drop unsupported node 16 from CI build matrix. Update setup-node action to v3 --------- Co-authored-by: Will Eastcott --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 178cb11d..9327f2d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI on: + workflow_dispatch: push: branches: [ main ] pull_request: @@ -10,61 +11,82 @@ jobs: build: name: Build runs-on: ubuntu-latest + timeout-minutes: 10 + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Setup Node.js 18.x - uses: actions/setup-node@v2.1.4 + uses: actions/setup-node@v3 with: node-version: 18.x + - name: Install dependencies - run: npm ci + run: npm clean-install --progress=false --no-fund + - name: Build PCUI run: npm run build test: name: Unit Tests runs-on: ubuntu-latest + timeout-minutes: 10 + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Setup Node.js 18.x - uses: actions/setup-node@v2.1.4 + uses: actions/setup-node@v3 with: node-version: 18.x + - name: Install dependencies - run: npm ci + run: npm clean-install --progress=false --no-fund + - name: Build PCUI run: npm run build:es6 + - name: Run unit tests run: npm test lint: name: Lint runs-on: ubuntu-latest + timeout-minutes: 10 + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Setup Node.js 18.x - uses: actions/setup-node@v2.1.4 + uses: actions/setup-node@v3 with: node-version: 18.x + - name: Install dependencies - run: npm ci + run: npm clean-install --progress=false --no-fund + - name: Run ESLint run: npm run lint lint-styles: name: Lint Styles runs-on: ubuntu-latest + timeout-minutes: 10 + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Setup Node.js 18.x - uses: actions/setup-node@v2.1.4 + uses: actions/setup-node@v3 with: node-version: 18.x + - name: Install dependencies - run: npm ci + run: npm clean-install --progress=false --no-fund + - name: Run Stylelint run: npm run lint:styles