From 00c14b274c390ac2b52274daf210ac10b055dc48 Mon Sep 17 00:00:00 2001 From: raghaves Date: Tue, 16 Jun 2020 17:54:50 +0530 Subject: [PATCH] Review comments fix: run npm install only with our build, npm install only dev for releases --- .github/workflows/test.yml | 19 ++++++++++++++++--- __tests__/run.test.ts | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e125e0d..79755cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,13 +17,25 @@ jobs: - name: 'Checking out repo code' uses: actions/checkout@v1 - - name: 'Validate build' + - name: Extract branch name + id: extract_branch + run: | + echo "##[set-output name=branchname;]$(echo ${GITHUB_REF##*/})" + + - name: 'Install dependency for master' + if: github.event.pull_request.base.ref == 'master' || steps.extract_branch.outputs.branchname == 'master' run: | npm install - npm build + + - name: 'Install dependency for releases' + if: github.event.pull_request.base.ref == 'releases/v1' || steps.extract_branch.outputs.branchname == 'releases/v1' + run: | + npm install --only=dev + - name: 'Run L0 tests' run: | npm run test + - name : 'Run test coverage' if: runner.os == 'Windows' env: @@ -65,4 +77,5 @@ jobs: $headers = @{ "Authorization" = "token ${env:GITHUB_TOKEN}" } - Invoke-RestMethod -Method POST -Uri $url -Headers $headers -Body "{ `"body`": `"${comment}`" }" \ No newline at end of file + $body = "{ `"body`": `"${comment}`" }" + Invoke-RestMethod -Method POST -Uri $url -Headers $headers -Body $body \ No newline at end of file diff --git a/__tests__/run.test.ts b/__tests__/run.test.ts index 1d6adbd..d5429b6 100644 --- a/__tests__/run.test.ts +++ b/__tests__/run.test.ts @@ -1,4 +1,4 @@ -import {run} from '../src/run' +import { run } from '../src/run' describe('This is a placeholder for intial test cases, to be removed', () => { test('Dummy test case', async () => {