From d9116b2def5960f8e25ad37fde617fe605288721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 16 Jul 2020 01:14:34 +0200 Subject: [PATCH 01/10] chore(ci): update `actions/cache` to v2 --- .github/workflows/test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f16a470e4a7..0871f80efb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache node_modules - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }} @@ -47,7 +47,7 @@ jobs: run: yarn install --check-files --frozen-lockfile --non-interactive - name: Cache workspace - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ github.workspace }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} @@ -71,7 +71,7 @@ jobs: node-version: ${{ matrix.node }} - name: Restore workspace cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ github.workspace }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} @@ -98,7 +98,7 @@ jobs: node-version: ${{ matrix.node }} - name: Restore workspace cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ github.workspace }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} @@ -125,7 +125,7 @@ jobs: node-version: ${{ matrix.node }} - name: Restore workspace cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ github.workspace }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} @@ -159,7 +159,7 @@ jobs: node-version: ${{ matrix.node }} - name: Restore workspace cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ github.workspace }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} @@ -192,7 +192,7 @@ jobs: node-version: ${{ matrix.node }} - name: Restore workspace cache - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ github.workspace }} key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} From 34e76fc2789353d274a826d0a0124b487d46ac30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 16 Jul 2020 21:21:47 +0200 Subject: [PATCH 02/10] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0871f80efb8..1d4f951a8da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,9 +37,9 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }} + key: ${{ runner.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }} + ${{ runner.os }}-node-v${{ matrix.node }}-yarn- ${{ runner.OS }}-node-v${{ matrix.node }}- ${{ runner.OS }}- From f43da5d32178b948f0409dc384fda053b60056be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 16 Jul 2020 21:32:48 +0200 Subject: [PATCH 03/10] Update test.yml --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d4f951a8da..31c859f2a1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,11 +37,11 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} + key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-node-v${{ matrix.node }}-yarn- - ${{ runner.OS }}-node-v${{ matrix.node }}- - ${{ runner.OS }}- + ${{ matrix.os }}-node-v${{ matrix.node }}-yarn- + ${{ matrix.os }}-node-v${{ matrix.node }}- + ${{ matrix.os }}- - name: Install dependencies run: yarn install --check-files --frozen-lockfile --non-interactive From 20ebc04c38ca49a0edafcf7b84291cce528de9dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 16 Jul 2020 21:57:43 +0200 Subject: [PATCH 04/10] fix(b-form-tags): unit tests --- src/components/form-tags/form-tags.spec.js | 59 ++++++++++------------ 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/src/components/form-tags/form-tags.spec.js b/src/components/form-tags/form-tags.spec.js index ed04723b62a..201f056ac28 100644 --- a/src/components/form-tags/form-tags.spec.js +++ b/src/components/form-tags/form-tags.spec.js @@ -3,10 +3,10 @@ import { createContainer, waitNT, waitRAF } from '../../../tests/utils' import { BFormTags } from './form-tags' describe('form-tags', () => { - it('has div as root element', async () => { + it('has expected default structure', async () => { const wrapper = mount(BFormTags) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.classes()).toContain('b-form-tags') expect(wrapper.classes()).toContain('form-control') expect(wrapper.attributes('role')).toBe('group') @@ -21,6 +21,7 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) + expect(wrapper.element.tagName).toBe('DIV') const $tags = wrapper.findAll('.b-form-tag') @@ -49,12 +50,10 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') - await wrapper.setProps({ - value: ['pear'] - }) + expect(wrapper.element.tagName).toBe('DIV') + await wrapper.setProps({ value: ['pear'] }) expect(wrapper.vm.tags).toEqual(['pear']) wrapper.destroy() @@ -72,13 +71,14 @@ describe('form-tags', () => { } } }) - expect(wrapper.element.tagName).toBe('DIV') + await waitNT(wrapper.vm) await waitRAF() + expect(wrapper.element.tagName).toBe('DIV') + expect(scope).toBeDefined() expect(typeof scope).toBe('object') - expect(Array.isArray(scope.tags)).toBe(true) expect(scope.tags).toEqual(['apple', 'orange']) expect(typeof scope.addTag).toBe('function') @@ -104,11 +104,11 @@ describe('form-tags', () => { name: 'foo' } }) + expect(wrapper.element.tagName).toBe('DIV') const $hidden = wrapper.findAll('input[type=hidden]') expect($hidden.length).toBe(2) - expect($hidden.at(0).attributes('value')).toEqual('apple') expect($hidden.at(0).attributes('name')).toEqual('foo') expect($hidden.at(1).attributes('value')).toEqual('orange') @@ -123,13 +123,12 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') expect($input.element.type).toBe('text') @@ -164,14 +163,13 @@ describe('form-tags', () => { value: ['apple', 'orange', 'pear', 'peach'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange', 'pear', 'peach']) expect(wrapper.vm.newTag).toEqual('') let $tags = wrapper.findAll('.badge') expect($tags.length).toBe(4) - expect($tags.at(1).attributes('title')).toEqual('orange') const $btn = $tags.at(1).find('button') @@ -194,13 +192,12 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') @@ -234,13 +231,12 @@ describe('form-tags', () => { value: ['one', 'two'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['one', 'two']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') @@ -295,8 +291,8 @@ describe('form-tags', () => { value: ['one', 'two'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['one', 'two']) expect(wrapper.vm.newTag).toEqual('') expect(wrapper.vm.duplicateTags).toEqual([]) @@ -306,7 +302,6 @@ describe('form-tags', () => { expect(wrapper.find('.form-text').exists()).toBe(false) const $input = wrapper.find('input') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') @@ -465,16 +460,16 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') - const $button = wrapper.find('button.b-form-tags-button') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') + + const $button = wrapper.find('button.b-form-tags-button') expect($button.exists()).toBe(true) expect($button.classes()).toContain('invisible') @@ -499,20 +494,18 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + await waitNT(wrapper.vm) await waitRAF() + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') - expect(wrapper.classes()).not.toContain('focus') const $input = wrapper.find('input') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') - expect(document.activeElement).not.toBe($input.element) await wrapper.trigger('click') @@ -552,22 +545,26 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + await waitNT(wrapper.vm) await waitRAF() + expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') - - expect(wrapper.classes()).not.toContain('focus') + expect(wrapper.classes()).toContain('focus') const $input = wrapper.find('input') - expect($input.exists()).toBe(true) expect($input.element.value).toBe('') - expect(document.activeElement).toBe($input.element) + wrapper.vm.blur() + await waitNT(wrapper.vm) + await waitRAF() + expect(wrapper.classes()).not.toContain('focus') + expect(document.activeElement).not.toBe($input.element) + wrapper.destroy() }) }) From f3e10017298d0716a758daaaa29d771c4642dc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 16 Jul 2020 21:58:41 +0200 Subject: [PATCH 05/10] Revert "fix(b-form-tags): unit tests" This reverts commit 20ebc04c38ca49a0edafcf7b84291cce528de9dc. --- src/components/form-tags/form-tags.spec.js | 59 ++++++++++++---------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/src/components/form-tags/form-tags.spec.js b/src/components/form-tags/form-tags.spec.js index 201f056ac28..ed04723b62a 100644 --- a/src/components/form-tags/form-tags.spec.js +++ b/src/components/form-tags/form-tags.spec.js @@ -3,10 +3,10 @@ import { createContainer, waitNT, waitRAF } from '../../../tests/utils' import { BFormTags } from './form-tags' describe('form-tags', () => { - it('has expected default structure', async () => { + it('has div as root element', async () => { const wrapper = mount(BFormTags) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.classes()).toContain('b-form-tags') expect(wrapper.classes()).toContain('form-control') expect(wrapper.attributes('role')).toBe('group') @@ -21,7 +21,6 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') const $tags = wrapper.findAll('.b-form-tag') @@ -50,10 +49,12 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') - await wrapper.setProps({ value: ['pear'] }) + await wrapper.setProps({ + value: ['pear'] + }) + expect(wrapper.vm.tags).toEqual(['pear']) wrapper.destroy() @@ -71,14 +72,13 @@ describe('form-tags', () => { } } }) - + expect(wrapper.element.tagName).toBe('DIV') await waitNT(wrapper.vm) await waitRAF() - expect(wrapper.element.tagName).toBe('DIV') - expect(scope).toBeDefined() expect(typeof scope).toBe('object') + expect(Array.isArray(scope.tags)).toBe(true) expect(scope.tags).toEqual(['apple', 'orange']) expect(typeof scope.addTag).toBe('function') @@ -104,11 +104,11 @@ describe('form-tags', () => { name: 'foo' } }) - expect(wrapper.element.tagName).toBe('DIV') const $hidden = wrapper.findAll('input[type=hidden]') expect($hidden.length).toBe(2) + expect($hidden.at(0).attributes('value')).toEqual('apple') expect($hidden.at(0).attributes('name')).toEqual('foo') expect($hidden.at(1).attributes('value')).toEqual('orange') @@ -123,12 +123,13 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') expect($input.element.type).toBe('text') @@ -163,13 +164,14 @@ describe('form-tags', () => { value: ['apple', 'orange', 'pear', 'peach'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.vm.tags).toEqual(['apple', 'orange', 'pear', 'peach']) expect(wrapper.vm.newTag).toEqual('') let $tags = wrapper.findAll('.badge') expect($tags.length).toBe(4) + expect($tags.at(1).attributes('title')).toEqual('orange') const $btn = $tags.at(1).find('button') @@ -192,12 +194,13 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') @@ -231,12 +234,13 @@ describe('form-tags', () => { value: ['one', 'two'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.vm.tags).toEqual(['one', 'two']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') @@ -291,8 +295,8 @@ describe('form-tags', () => { value: ['one', 'two'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.vm.tags).toEqual(['one', 'two']) expect(wrapper.vm.newTag).toEqual('') expect(wrapper.vm.duplicateTags).toEqual([]) @@ -302,6 +306,7 @@ describe('form-tags', () => { expect(wrapper.find('.form-text').exists()).toBe(false) const $input = wrapper.find('input') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') @@ -460,16 +465,16 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - expect(wrapper.element.tagName).toBe('DIV') + expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') const $input = wrapper.find('input') + const $button = wrapper.find('button.b-form-tags-button') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') - - const $button = wrapper.find('button.b-form-tags-button') expect($button.exists()).toBe(true) expect($button.classes()).toContain('invisible') @@ -494,18 +499,20 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - + expect(wrapper.element.tagName).toBe('DIV') await waitNT(wrapper.vm) await waitRAF() - expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') + expect(wrapper.classes()).not.toContain('focus') const $input = wrapper.find('input') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') + expect(document.activeElement).not.toBe($input.element) await wrapper.trigger('click') @@ -545,25 +552,21 @@ describe('form-tags', () => { value: ['apple', 'orange'] } }) - + expect(wrapper.element.tagName).toBe('DIV') await waitNT(wrapper.vm) await waitRAF() - expect(wrapper.element.tagName).toBe('DIV') expect(wrapper.vm.tags).toEqual(['apple', 'orange']) expect(wrapper.vm.newTag).toEqual('') - expect(wrapper.classes()).toContain('focus') + + expect(wrapper.classes()).not.toContain('focus') const $input = wrapper.find('input') + expect($input.exists()).toBe(true) expect($input.element.value).toBe('') - expect(document.activeElement).toBe($input.element) - wrapper.vm.blur() - await waitNT(wrapper.vm) - await waitRAF() - expect(wrapper.classes()).not.toContain('focus') - expect(document.activeElement).not.toBe($input.element) + expect(document.activeElement).toBe($input.element) wrapper.destroy() }) From 16edf00aef4cd8d9a38ef41f9fe33ae047cd81f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Tue, 21 Jul 2020 21:18:04 +0200 Subject: [PATCH 06/10] Split actions --- .github/workflows/build.yml | 49 +++++++++++ .github/workflows/bundlewatch.yml | 54 ++++++++++++ .github/workflows/test.yml | 139 +++++++----------------------- 3 files changed, 133 insertions(+), 109 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/bundlewatch.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..fc7019abfe7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build + +on: + push: + branches: + - dev + - master + pull_request: + branches: + - dev + - master + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [10, 12] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache node_modules + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.os }}-node-v${{ matrix.node }}-yarn- + ${{ matrix.os }}-node-v${{ matrix.node }}- + ${{ matrix.os }}- + + - name: Install dependencies + run: yarn install --check-files --frozen-lockfile --non-interactive + + - name: Build + run: yarn run build diff --git a/.github/workflows/bundlewatch.yml b/.github/workflows/bundlewatch.yml new file mode 100644 index 00000000000..161e704e078 --- /dev/null +++ b/.github/workflows/bundlewatch.yml @@ -0,0 +1,54 @@ +name: BundleWatch + +on: + push: + branches: + - dev + - master + pull_request: + branches: + - dev + - master + +jobs: + bundlewatch: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [12] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache node_modules + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.os }}-node-v${{ matrix.node }}-yarn- + ${{ matrix.os }}-node-v${{ matrix.node }}- + ${{ matrix.os }}- + + - name: Install dependencies + run: yarn install --check-files --frozen-lockfile --non-interactive + + - name: Build + run: yarn run build + + - name: BundleWatch + run: yarn run bundlewatch + env: + BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 31c859f2a1c..dab5f5e7b6a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,14 +11,13 @@ on: - master jobs: - setup: + lint: runs-on: ${{ matrix.os }} - if: github.event_name == 'push' || !(github.base_ref == 'master' && github.head_ref == 'dev') strategy: matrix: os: [ubuntu-latest] - node: [10, 12] + node: [12] steps: - name: Clone repository @@ -46,41 +45,10 @@ jobs: - name: Install dependencies run: yarn install --check-files --frozen-lockfile --non-interactive - - name: Cache workspace - uses: actions/cache@v2 - with: - path: ${{ github.workspace }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} - - lint: - needs: setup - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - node: [12] - - steps: - - name: Clone repository - uses: actions/checkout@v2 - - - name: Set Node.js version - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - name: Restore workspace cache - uses: actions/cache@v2 - with: - path: ${{ github.workspace }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} - - name: Lint run: yarn run test:lint audit: - needs: setup runs-on: ${{ matrix.os }} strategy: @@ -97,17 +65,27 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Restore workspace cache + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache node_modules uses: actions/cache@v2 with: - path: ${{ github.workspace }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.os }}-node-v${{ matrix.node }}-yarn- + ${{ matrix.os }}-node-v${{ matrix.node }}- + ${{ matrix.os }}- + + - name: Install dependencies + run: yarn install --check-files --frozen-lockfile --non-interactive - name: Audit run: yarn run audit test-unit: - needs: setup runs-on: ${{ matrix.os }} strategy: @@ -124,11 +102,22 @@ jobs: with: node-version: ${{ matrix.node }} - - name: Restore workspace cache + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache node_modules uses: actions/cache@v2 with: - path: ${{ github.workspace }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.os }}-node-v${{ matrix.node }}-yarn- + ${{ matrix.os }}-node-v${{ matrix.node }}- + ${{ matrix.os }}- + + - name: Install dependencies + run: yarn install --check-files --frozen-lockfile --non-interactive - name: Test unit run: yarn run test:unit --coverage --maxWorkers=2 @@ -139,71 +128,3 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} flags: unittests - - build: - needs: setup - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - node: [12] - - steps: - - name: Clone repository - uses: actions/checkout@v2 - - - name: Set Node.js version - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - name: Restore workspace cache - uses: actions/cache@v2 - with: - path: ${{ github.workspace }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} - - - name: Build - run: yarn run build - - - name: Upload build files - uses: actions/upload-artifact@v1 - with: - name: build-files - path: dist - - bundlewatch: - needs: build - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - node: [12] - - steps: - - name: Clone repository - uses: actions/checkout@v2 - - - name: Set Node.js version - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - name: Restore workspace cache - uses: actions/cache@v2 - with: - path: ${{ github.workspace }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }} - - - name: Download build files - uses: actions/download-artifact@v1 - with: - name: build-files - path: dist - - - name: BundleWatch - run: yarn run bundlewatch - env: - BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" From 087c05bfd093fdaae6d55fb1880a40e25b957d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Tue, 21 Jul 2020 21:22:49 +0200 Subject: [PATCH 07/10] Run BundleWatch during build --- .github/workflows/build.yml | 6 ++++ .github/workflows/bundlewatch.yml | 54 ------------------------------- .github/workflows/test.yml | 2 +- 3 files changed, 7 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/bundlewatch.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc7019abfe7..0b952659914 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,3 +47,9 @@ jobs: - name: Build run: yarn run build + + - name: BundleWatch + run: yarn run bundlewatch + if: matrix.node == '12' + env: + BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" diff --git a/.github/workflows/bundlewatch.yml b/.github/workflows/bundlewatch.yml deleted file mode 100644 index 161e704e078..00000000000 --- a/.github/workflows/bundlewatch.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: BundleWatch - -on: - push: - branches: - - dev - - master - pull_request: - branches: - - dev - - master - -jobs: - bundlewatch: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - node: [12] - - steps: - - name: Clone repository - uses: actions/checkout@v2 - - - name: Set Node.js version - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: Cache node_modules - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ matrix.os }}-node-v${{ matrix.node }}-yarn- - ${{ matrix.os }}-node-v${{ matrix.node }}- - ${{ matrix.os }}- - - - name: Install dependencies - run: yarn install --check-files --frozen-lockfile --non-interactive - - - name: Build - run: yarn run build - - - name: BundleWatch - run: yarn run bundlewatch - env: - BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dab5f5e7b6a..b11c217ac57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,7 +124,7 @@ jobs: - name: CodeCov uses: codecov/codecov-action@v1 - if: matrix.node == '10' + if: matrix.node == '12' with: token: ${{ secrets.CODECOV_TOKEN }} flags: unittests From ed4ad3deb59624e8e46f7f46dc9175412b24b8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Tue, 21 Jul 2020 21:34:59 +0200 Subject: [PATCH 08/10] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b952659914..0d616816f04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,3 +53,4 @@ jobs: if: matrix.node == '12' env: BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" + CI_BRANCH_BASE: "${{ github.base_ref }}" From 67b3586c356e7dec9bd5d61bbafcd89982a43ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Tue, 21 Jul 2020 21:40:03 +0200 Subject: [PATCH 09/10] Revert "Update build.yml" This reverts commit ed4ad3deb59624e8e46f7f46dc9175412b24b8f4. --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d616816f04..0b952659914 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,4 +53,3 @@ jobs: if: matrix.node == '12' env: BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" - CI_BRANCH_BASE: "${{ github.base_ref }}" From 72599f8c2bc67fcd66c4ad7c362292259c78e4bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Tue, 21 Jul 2020 21:52:26 +0200 Subject: [PATCH 10/10] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b952659914..1fe1b07a15e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,4 +52,4 @@ jobs: run: yarn run bundlewatch if: matrix.node == '12' env: - BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" + BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_TOKEN }}"