From 304694bcbaf4c64cfcd9c760ed2555426b6b07c3 Mon Sep 17 00:00:00 2001 From: Graham Barber Date: Mon, 25 May 2020 14:24:03 -0700 Subject: [PATCH] ci(actions): fix job execution order On push to master, run tests and then attempt a release. On pull requests to master when specific files are changed, run unit tests. --- .github/workflows/release.yml | 4 +++- .github/workflows/unit-tests.yml | 13 +++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef62887..e97f599 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: release: - name: Release + name: Test and Release runs-on: ubuntu-18.04 steps: - name: Checkout @@ -17,6 +17,8 @@ jobs: node-version: 14 - name: Install dependencies run: npm ci + - name: Run unit tests + run: npm test - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 8a7b119..38676bb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -4,15 +4,13 @@ name: Unit tests on: - push: - branches: [ master ] pull_request: branches: [ master ] - paths: - - 'index.js' - - 'test.js' - - 'data/*.js' - - 'package-lock.json' + paths: + - 'index.js' + - 'test.js' + - 'data/*.js' + - 'package-lock.json' jobs: build: @@ -26,5 +24,4 @@ jobs: with: node-version: 14 - run: npm ci - - run: npm run build --if-present - run: npm test -- 2.51.2