From 669c49663e5f3a093a19602845dd51462d7fa888 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 05:49:10 +0000 Subject: [PATCH 1/7] feat: add GitHub action to unit test PR --- .github/workflows/build.yml | 28 +++++++++++++++++++ .../{codebuild-pr-test.yml => push.yml} | 4 +-- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{codebuild-pr-test.yml => push.yml} (90%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000000..cc2f0f1b7eb43 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: [pull_request] + +jobs: + test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: yarn and test + run: | + yarn --frozen-lockfile + yarn audit + lerna run build --since ${{ github.base_ref }} --include-dependents + lerna run test --since ${{ github.base_ref }} + env: + CI: true + working-directory: app \ No newline at end of file diff --git a/.github/workflows/codebuild-pr-test.yml b/.github/workflows/push.yml similarity index 90% rename from .github/workflows/codebuild-pr-test.yml rename to .github/workflows/push.yml index 67853b57ec683..7f57976c6ad73 100644 --- a/.github/workflows/codebuild-pr-test.yml +++ b/.github/workflows/push.yml @@ -1,10 +1,8 @@ -name: CI +name: Push on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: build: From 23cd8c2a0e62559076c5cd00febfa07b44abe909 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 05:54:53 +0000 Subject: [PATCH 2/7] fix: install yarn in build.yml Refs: https://codyogden.blog/yarn-with-github-actions-ci-cd/ --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc2f0f1b7eb43..6109683507bf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,8 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: yarn and test + - run: npm install -g yarn + - name: yarn install, build and test run: | yarn --frozen-lockfile yarn audit From edd09594c119a6ad38ecebadb4ce32ad50fec401 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 06:12:47 +0000 Subject: [PATCH 3/7] fix: remove working-directory --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6109683507bf2..92c2d6fcaad39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,5 +25,4 @@ jobs: lerna run build --since ${{ github.base_ref }} --include-dependents lerna run test --since ${{ github.base_ref }} env: - CI: true - working-directory: app \ No newline at end of file + CI: true \ No newline at end of file From d18dcda239edf2f60f4e81c32b0c3c84d26b4a7c Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 06:15:35 +0000 Subject: [PATCH 4/7] chore: remove yarn audit from build.yml --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92c2d6fcaad39..842f100c99d97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,6 @@ jobs: - name: yarn install, build and test run: | yarn --frozen-lockfile - yarn audit lerna run build --since ${{ github.base_ref }} --include-dependents lerna run test --since ${{ github.base_ref }} env: From 8b0ad411a125e2f4f81416405302153039ae2b65 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 06:19:16 +0000 Subject: [PATCH 5/7] fix: call lerna from node_modules --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 842f100c99d97..671606f935a5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: yarn install, build and test run: | yarn --frozen-lockfile - lerna run build --since ${{ github.base_ref }} --include-dependents - lerna run test --since ${{ github.base_ref }} + ./node_modules/.bin/lerna run build --since ${{ github.base_ref }} --include-dependents + ./node_modules/.bin/lerna run test --since ${{ github.base_ref }} env: CI: true \ No newline at end of file From 436773230f3c87a4a1c40951378cf982acddecde Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 06:29:16 +0000 Subject: [PATCH 6/7] chore: use actions/checkout@v2 and pass ref Refs: https://github.com/actions/checkout/issues/118#issuecomment-570441877 --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 671606f935a5b..5bda43429b0a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,9 @@ jobs: node-version: [10.x, 12.x, 14.x] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + with: + ref: ${{ github.base_ref }} - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: From b4aac5c8bccfb4cbb9f4511e6c9a3ae1e26b989a Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 16 Jun 2020 14:16:30 +0000 Subject: [PATCH 7/7] chore: incorporate learnings from middleware-retry PR --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bda43429b0a1..9986269fe3e03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ github.base_ref }} + fetch-depth: 0 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -23,7 +23,7 @@ jobs: - name: yarn install, build and test run: | yarn --frozen-lockfile - ./node_modules/.bin/lerna run build --since ${{ github.base_ref }} --include-dependents - ./node_modules/.bin/lerna run test --since ${{ github.base_ref }} + ./node_modules/.bin/lerna run pretest --since origin/${{ github.base_ref }} --include-dependencies + ./node_modules/.bin/lerna run test --since origin/${{ github.base_ref }} env: CI: true \ No newline at end of file