From c00768b7c77534032af72d6fdb21cb8c6169c2ac Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 21 May 2022 15:08:07 +0200 Subject: [PATCH] Move ci before tests --- .github/workflows/ci.yml | 63 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26b69586f..5485fe93e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,37 +3,6 @@ name: CI on: [push, pull_request] jobs: - tests: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - node: [14, 16, 17, 18] - exclude: - - os: windows-latest # https://github.com/serialport/node-serialport/issues/2344 - node: 17 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - registry-url: https://registry.npmjs.org/ - - - name: Restore node_modules cache - id: cache-node-modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('npm-shrinkwrap.json') }} - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: npm ci - - name: Lint - run: npm run eslint - - name: Build - run: npm run build - - name: Test - run: npm run test-with-coverage ci: runs-on: ubuntu-latest steps: @@ -113,3 +82,35 @@ jobs: --data '{"definition": {"id": 9}}' \ -u ${{ secrets.HASSIO_TRIGGER_SECRET }} \ "https://dev.azure.com/zigbee2mqtt/Zigbee2mqtt%20Add-on/_apis/build/builds?api-version=5.1" + + tests: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + node: [14, 16, 17, 18] + exclude: + - os: windows-latest # https://github.com/serialport/node-serialport/issues/2344 + node: 17 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + registry-url: https://registry.npmjs.org/ + + - name: Restore node_modules cache + id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('npm-shrinkwrap.json') }} + - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm ci + - name: Lint + run: npm run eslint + - name: Build + run: npm run build + - name: Test + run: npm run test-with-coverage \ No newline at end of file