From 00a29163794c5d161ae364374b09deaa41330af9 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:04:41 +0900 Subject: [PATCH 01/17] Bump Node LTS and use circleci/cimg --- .circleci/config.yml | 4 ++-- .github/workflows/test-win.yml | 2 +- .nvmrc | 2 +- Dockerfile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f186cc66..64bcb291 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,13 +11,13 @@ executors: default: false version: type: string - default: '16.13.1' # Specify LTS version for development + default: '16.14' # Specify LTS major and minor for development docker: - image: circleci/node:<< parameters.version >><<# parameters.browser >>-browsers<> entrypoint: - docker-init - -- - - <<# parameters.browser >>/<>docker-entrypoint.sh + - <<^ parameters.browser >>/usr/local/bin<>/docker-entrypoint.sh command: - /bin/sh working_directory: ~/marp-cli diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 93cccc4a..dd49b24d 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -17,7 +17,7 @@ jobs: node-version: - '^12.22.7' - '^14.18.1' - - '16.14.0' + - '16.14.2' steps: - uses: actions/checkout@v2 diff --git a/.nvmrc b/.nvmrc index 832d3850..d9f88006 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.14.0 +16.14.2 diff --git a/Dockerfile b/Dockerfile index e0153675..b4dfb8e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.14.0-alpine +FROM node:16.14.2-alpine LABEL maintainer "Marp team" RUN apk update && apk upgrade && \ From e4cd4902ae4ec8526b4685e5e15d26e85a5e2fd8 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:06:22 +0900 Subject: [PATCH 02/17] Fix the name of cimg Docker image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64bcb291..6e82c8f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ executors: type: string default: '16.14' # Specify LTS major and minor for development docker: - - image: circleci/node:<< parameters.version >><<# parameters.browser >>-browsers<> + - image: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<> entrypoint: - docker-init - -- From dcff87569f774f56d3328eacc06dc4c57f319150 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:11:53 +0900 Subject: [PATCH 03/17] Fix Docker entrypoint not to use custom entrypoint --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e82c8f4..2e68eaaa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,14 +17,11 @@ executors: entrypoint: - docker-init - -- - - <<^ parameters.browser >>/usr/local/bin<>/docker-entrypoint.sh - command: - - /bin/sh working_directory: ~/marp-cli docker: machine: - image: ubuntu-2004:202101-01 + image: ubuntu-2004:202111-02 docker_layer_caching: true working_directory: ~/marp-cli environment: From 6d73a45f1300d8e4eee625dffd404ee9509ec990 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:21:36 +0900 Subject: [PATCH 04/17] Remove Docker entrypoint setting from config.yml --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e68eaaa..70706937 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,9 +14,6 @@ executors: default: '16.14' # Specify LTS major and minor for development docker: - image: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<> - entrypoint: - - docker-init - - -- working_directory: ~/marp-cli docker: From 014cf19e218712646fa891ddfcf339d6bc6faebb Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:23:10 +0900 Subject: [PATCH 05/17] Fix audit for test --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4b02e522..7de24027 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5220,9 +5220,9 @@ minimist-options@4.1.0: kind-of "^6.0.3" minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mj-context-menu@^0.6.1: version "0.6.1" From 73c209f2296ec12ae5fbbfecd31dfa3c68929ecb Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:38:51 +0900 Subject: [PATCH 06/17] Use circleci/browser-tools orb --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70706937..2ecc0c44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 orbs: + browser-tools: circleci/browser-tools@1.2.4 codecov: codecov/codecov@3.2.2 executors: @@ -52,6 +53,11 @@ commands: paths: - ~/.cache/yarn + - when: + condition: << parameters.browser >> + steps: + - browser-tools/install-chrome + audit: steps: - checkout From 79556207ce3fd480f34163e49b192ef8ca49efae Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 21:52:15 +0900 Subject: [PATCH 07/17] Define browser as test command parameter --- .circleci/config.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ecc0c44..616ada9f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,11 +53,6 @@ commands: paths: - ~/.cache/yarn - - when: - condition: << parameters.browser >> - steps: - - browser-tools/install-chrome - audit: steps: - checkout @@ -66,12 +61,21 @@ commands: - run: yarn -s check:audit test: + parameters: + browser: + type: boolean + default: false steps: - run: node --version - checkout - install + - when: + condition: << parameters.browser >> + steps: + - browser-tools/install-chrome + - run: name: Prettier formatting command: yarn check:format @@ -180,7 +184,8 @@ jobs: browser: true version: '12.22' steps: - - test + - test: + browser: true test-node14: executor: @@ -188,14 +193,16 @@ jobs: browser: true version: '14.18' steps: - - test + - test: + browser: true test-node16: executor: name: node browser: true steps: - - test + - test: + browser: true docker-build-latest: executor: node From 785113f9fe6d04f65ff48efffba96c54e355ab58 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 22:22:08 +0900 Subject: [PATCH 08/17] Simplify docker image definition --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 616ada9f..bac8614f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,8 +13,7 @@ executors: version: type: string default: '16.14' # Specify LTS major and minor for development - docker: - - image: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<> + docker: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<> working_directory: ~/marp-cli docker: From 5d78276230a0ccf1c5425cb9e04b1a5d344b234d Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 22:40:59 +0900 Subject: [PATCH 09/17] Set concurrency for test workflow for Windows --- .github/workflows/github-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 5b302d89..2bf9e3d7 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -5,6 +5,10 @@ on: tags: - v* +concurrency: + group: ${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }} + cancel-in-progress: true + env: YARN_VERSION: '^1.22.17' From 5c7d02bee74e5d02b81bddbbb3f7cfe6c229256f Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 22:42:41 +0900 Subject: [PATCH 10/17] Fix invalid format of config.yml --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bac8614f..616ada9f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,8 @@ executors: version: type: string default: '16.14' # Specify LTS major and minor for development - docker: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<> + docker: + - image: cimg/node:<< parameters.version >><<# parameters.browser >>-browsers<> working_directory: ~/marp-cli docker: From 5cd7d63e824898f86d8c637454d78ab5215a2736 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 22:43:50 +0900 Subject: [PATCH 11/17] Fix the target of concurrency setting --- .github/workflows/github-release.yml | 4 ---- .github/workflows/test-win.yml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 2bf9e3d7..5b302d89 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -5,10 +5,6 @@ on: tags: - v* -concurrency: - group: ${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }} - cancel-in-progress: true - env: YARN_VERSION: '^1.22.17' diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index dd49b24d..447f07b5 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -4,6 +4,10 @@ on: - pull_request - push +concurrency: + group: ${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }} + cancel-in-progress: true + env: YARN_VERSION: '^1.22.17' From ad6bd2ad008adc9e187942806f81328f83d4604d Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 29 Mar 2022 22:46:30 +0900 Subject: [PATCH 12/17] Debug concurrency group --- .github/workflows/test-win.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 447f07b5..f6dd37b2 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -24,6 +24,9 @@ jobs: - '16.14.2' steps: + - name: Output concurrency group + run: echo "${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }}" + - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} From 4a0ee2ad20f795c7d8213cbfc9a30de6fabb6f4d Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 30 Mar 2022 02:20:28 +0900 Subject: [PATCH 13/17] Add --detectOpenHandles jest option for test on Windows --- .github/workflows/test-win.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index f6dd37b2..15be413c 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -56,9 +56,9 @@ jobs: # https://stackoverflow.com/a/59365905 - name: Jest run: >- - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit || - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache || - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --detectOpenHandles || + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache --detectOpenHandles || + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache --detectOpenHandles env: CI: true From 69a46eeb4e9973b0a81c09264371ff8ef34dc5d7 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 30 Mar 2022 02:51:36 +0900 Subject: [PATCH 14/17] Revert concurrency --- .github/workflows/test-win.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 15be413c..b319aae6 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -4,9 +4,9 @@ on: - pull_request - push -concurrency: - group: ${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }} - cancel-in-progress: true +# concurrency: +# group: ${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }} +# cancel-in-progress: true env: YARN_VERSION: '^1.22.17' From 811ebe689eb711c9a8b95eeddf3d4e9b88dd7cb7 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 30 Mar 2022 03:29:14 +0900 Subject: [PATCH 15/17] Increase Jest timeout for Puppeteer to 1m --- .github/workflows/test-win.yml | 6 +++--- test/converter.ts | 2 +- test/marp-cli.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index b319aae6..9df089a5 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -56,9 +56,9 @@ jobs: # https://stackoverflow.com/a/59365905 - name: Jest run: >- - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --detectOpenHandles || - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache --detectOpenHandles || - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache --detectOpenHandles + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit || + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache || + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache env: CI: true diff --git a/test/converter.ts b/test/converter.ts index 8a39d8f8..6ae06f77 100644 --- a/test/converter.ts +++ b/test/converter.ts @@ -18,7 +18,7 @@ import { bare as bareTpl } from '../src/templates' import { ThemeSet } from '../src/theme' import { WatchNotifier } from '../src/watcher' -const puppeteerTimeoutMs = 15000 +const puppeteerTimeoutMs = 60000 jest.mock('fs') diff --git a/test/marp-cli.ts b/test/marp-cli.ts index 6bd84053..7fa30514 100644 --- a/test/marp-cli.ts +++ b/test/marp-cli.ts @@ -902,7 +902,7 @@ describe('Marp CLI', () => { it('does not open PPTX in preview window', async () => { await runForObservation([onePath, '-p', '--pptx', '--no-output']) expect(Preview.prototype.open).not.toHaveBeenCalled() - }, 30000) + }, 60000) }) describe('when CLI is running in an official Docker image', () => { From f6fbac246cb8a5e7ac3dc087ef577e3d4d5a4e66 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Sat, 2 Apr 2022 15:39:49 +0900 Subject: [PATCH 16/17] Update Windows test workflow to use forceExit flag --- .github/workflows/test-win.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 9df089a5..1347b336 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -24,8 +24,8 @@ jobs: - '16.14.2' steps: - - name: Output concurrency group - run: echo "${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }}" + # - name: Output concurrency group + # run: echo "${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }}" - uses: actions/checkout@v2 @@ -56,9 +56,9 @@ jobs: # https://stackoverflow.com/a/59365905 - name: Jest run: >- - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit || - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache || - yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --no-cache + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --forceExit || + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache || + yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache env: CI: true From 6f7b38b3a6d8700e84aaa5d6e4d286a83f7bb17b Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Sat, 2 Apr 2022 15:51:40 +0900 Subject: [PATCH 17/17] [ci skip] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b76696d1..8ea8c83f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- Bump Node LTS, and improve CI settings ([#437](https://github.com/marp-team/marp-cli/pull/437)) + ## v1.7.0 - 2022-02-23 ### Added