From 27171eeb85c7129f44300add774a6959347817d9 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:46:55 +0530 Subject: [PATCH 1/7] chore(ci/pr): print size of respec-w3c --- .github/workflows/pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index be33aac3c1..c2b2cce381 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -50,6 +50,11 @@ jobs: run: | npm ci npm run build:w3c + - name: Size of respec-w3c + run: | + npx brrr builds/respec-w3c.js -o builds + gzip -k builds/respec-w3c.js + stat -c "%s|%n" builds/respec-w3c.js* | column -ts'|' - run: npm run test:headless test-karma: From c99ee7a90ed672a5c51c44a4f7f28385fc669c3f Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:49:32 +0530 Subject: [PATCH 2/7] silent npx --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c2b2cce381..64788ce3f3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -52,7 +52,7 @@ jobs: npm run build:w3c - name: Size of respec-w3c run: | - npx brrr builds/respec-w3c.js -o builds + npx -q brrr builds/respec-w3c.js -o builds gzip -k builds/respec-w3c.js stat -c "%s|%n" builds/respec-w3c.js* | column -ts'|' - run: npm run test:headless From c9ceb38882146ccf4f62b57076364289f18797fd Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:56:27 +0530 Subject: [PATCH 3/7] no need to use column --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 64788ce3f3..9b11fcce3c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -54,7 +54,7 @@ jobs: run: | npx -q brrr builds/respec-w3c.js -o builds gzip -k builds/respec-w3c.js - stat -c "%s|%n" builds/respec-w3c.js* | column -ts'|' + stat -c "%6s %n" builds/respec-w3c.js* - run: npm run test:headless test-karma: From 7bdc388797e15eb4afb75900c6ec44a1e8a085f5 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 23 Mar 2021 16:27:44 +0530 Subject: [PATCH 4/7] try building an action --- .github/workflows/pr.yml | 82 ++++++++++------------------------------ 1 file changed, 21 insertions(+), 61 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9b11fcce3c..73fda02d48 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,68 +16,28 @@ env: LC_ALL: en_US.UTF-8 jobs: - lint: - name: Check linting issues + size: + name: Report respec-w3c size runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - name: Cache node modules - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-12-${{ hashFiles('**/package-lock.json') }} - - run: npm ci - - run: npm run lint - - test-headless: - name: Headless Tests - runs-on: ubuntu-latest - needs: lint - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - name: Cache node modules - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-12-${{ hashFiles('**/package-lock.json') }} - - name: install & build - run: | - npm ci - npm run build:w3c - - name: Size of respec-w3c - run: | - npx -q brrr builds/respec-w3c.js -o builds - gzip -k builds/respec-w3c.js - stat -c "%6s %n" builds/respec-w3c.js* - - run: npm run test:headless - - test-karma: - name: Karma Unit Tests (${{ matrix.browser }}) - strategy: - matrix: - browser: [ChromeHeadless, FirefoxHeadless] - runs-on: ubuntu-latest - needs: lint - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - name: Cache node modules - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-12-${{ hashFiles('**/package-lock.json') }} - - name: install & build - run: | - npm ci - npm run build:w3c & npm run build:geonovum - - run: npm run test:karma + - name: Dump GitHub context + run: echo "$GITHUB_CONTEXT" env: - BROWSERS: ${{ matrix.browser }} + GITHUB_CONTEXT: ${{ toJSON(github) }} + # - uses: actions/setup-node@v1 + # with: + # node-version: 12 + # - name: Cache node modules + # uses: actions/cache@v1 + # with: + # path: ~/.npm + # key: ${{ runner.os }}-node-12-${{ hashFiles('**/package-lock.json') }} + # # - name: Get current size + # id: current-size + # run: | + # npm ci + # npm run build:w3c + # gzip -k builds/respec-w3c.js + # stat -c "%6s %n" builds/respec-w3c.js* + # git clean -fd && git checkout -- . From df3f140b145686dab37a6ae49794cbb141f25511 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 23 Mar 2021 16:33:41 +0530 Subject: [PATCH 5/7] try building an action: part 2 --- .github/workflows/pr.yml | 43 +++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 73fda02d48..34eae74261 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,19 +25,30 @@ jobs: run: echo "$GITHUB_CONTEXT" env: GITHUB_CONTEXT: ${{ toJSON(github) }} - # - uses: actions/setup-node@v1 - # with: - # node-version: 12 - # - name: Cache node modules - # uses: actions/cache@v1 - # with: - # path: ~/.npm - # key: ${{ runner.os }}-node-12-${{ hashFiles('**/package-lock.json') }} - # # - name: Get current size - # id: current-size - # run: | - # npm ci - # npm run build:w3c - # gzip -k builds/respec-w3c.js - # stat -c "%6s %n" builds/respec-w3c.js* - # git clean -fd && git checkout -- . + - uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Cache node modules + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-12-${{ hashFiles('**/package-lock.json') }} + - name: Get current size + id: current-size + run: | + npm ci + npm run build:w3c + gzip -k builds/respec-w3c.js + stat -c "%6s %n" builds/respec-w3c.js* + git clean -fd && git checkout -- . + - name: Get base size + id: base-size + run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }} + git checkout ${{ github.base_ref }} + npm ci + npm run build:w3c + gzip -k builds/respec-w3c.js + stat -c "%6s %n" builds/respec-w3c.js* + git clean -fd && git checkout -- . + git checkout ${{ github.ref }} From 612263b3eecf2b0276788dbe181f087ad95fe574 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 23 Mar 2021 16:35:16 +0530 Subject: [PATCH 6/7] checkout prev? --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 34eae74261..3e461e7540 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -51,4 +51,4 @@ jobs: gzip -k builds/respec-w3c.js stat -c "%6s %n" builds/respec-w3c.js* git clean -fd && git checkout -- . - git checkout ${{ github.ref }} + git checkout - From e464b16f180b16b245d7141d74969e9d7c785596 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 23 Mar 2021 17:42:50 +0530 Subject: [PATCH 7/7] cleanup --- .github/workflows/pr.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3e461e7540..cd42ff44b7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,10 +21,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Dump GitHub context - run: echo "$GITHUB_CONTEXT" - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - uses: actions/setup-node@v1 with: node-version: 12 @@ -44,7 +40,7 @@ jobs: - name: Get base size id: base-size run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }} + git fetch --depth=1 origin +refs/heads/${{ github.base_ref }} git checkout ${{ github.base_ref }} npm ci npm run build:w3c