From 047205bf02784a768299c75c54d32a0b8775f937 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sun, 15 Sep 2019 00:48:58 +0800 Subject: [PATCH 01/17] Update nodejs.yml --- .github/workflows/nodejs.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 000000000..4f1b2555e --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,25 @@ +name: Node CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [8.x, 10.x, 12.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: Install dependencies + run: yarn + - name: Test + run: yarn test + env: + CI: true From 1e997957860263dfe4bdaa3b78d90ba472b78664 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sun, 15 Sep 2019 00:52:03 +0800 Subject: [PATCH 02/17] drop node 8 support --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4f1b2555e..384a46735 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [8.x, 10.x, 12.x] + node-version: [10.x, 12.x] steps: - uses: actions/checkout@v1 From 57625d131b191fad48dc401195a1c26473623198 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sun, 15 Sep 2019 01:00:01 +0800 Subject: [PATCH 03/17] test on windows and macos --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 384a46735..07d32f046 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: [ubuntu-latest, windows-latest, macOS-latest] strategy: matrix: From e3e29aa53194655e39fc00b55d761bd981621cc5 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sun, 15 Sep 2019 01:02:14 +0800 Subject: [PATCH 04/17] fix previous commit --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 07d32f046..384a46735 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: [ubuntu-latest, windows-latest, macOS-latest] + runs-on: ubuntu-latest strategy: matrix: From 4107ad86c77af2691d7e664ff9d0a3d4d0006559 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sun, 15 Sep 2019 01:04:04 +0800 Subject: [PATCH 05/17] proper matrix settings --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 384a46735..fd06c35fb 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -10,6 +10,7 @@ jobs: strategy: matrix: node-version: [10.x, 12.x] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v1 From e45bec77c9115c1ce5559c4f442a0ec05c5b2f28 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sun, 15 Sep 2019 01:06:54 +0800 Subject: [PATCH 06/17] Update nodejs.yml --- .github/workflows/nodejs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index fd06c35fb..0f4c2304c 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -3,9 +3,9 @@ name: Node CI on: [push, pull_request] jobs: - build: - - runs-on: ubuntu-latest + test: + name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: matrix: From 6595c534132c975a4d579114d0a96f8690e1a1c4 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 16:29:42 +0800 Subject: [PATCH 07/17] use cache --- .github/workflows/nodejs.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0f4c2304c..15879b5af 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -3,7 +3,7 @@ name: Node CI on: [push, pull_request] jobs: - test: + test: name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -14,12 +14,23 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + + - name: Cache node modules + uses: actions/cache@preview + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies run: yarn + - name: Test run: yarn test env: From 9b17fa75c49de3749f875fed51a8703e0f5d2c8a Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 16:35:41 +0800 Subject: [PATCH 08/17] only test master branch --- .github/workflows/nodejs.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 15879b5af..3e702b449 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,6 +1,12 @@ name: Node CI -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master + paths-ignore: + - '**.md' jobs: test: From 0738e4bab8ebffb17330b63eb5327c560b497be5 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 16:45:46 +0800 Subject: [PATCH 09/17] tweaks --- .github/workflows/nodejs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3e702b449..9f26941ec 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -29,10 +29,10 @@ jobs: - name: Cache node modules uses: actions/cache@preview with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + path: ~/.cache/yarn + key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} restore-keys: | - ${{ runner.os }}-node- + ${{ runner.os }}-yarn- - name: Install dependencies run: yarn From aa4bd253948f3bbde66b8586dad32082b46eae76 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:00:31 +0800 Subject: [PATCH 10/17] try to fix it on windows --- .github/workflows/{nodejs.yml => ci.yml} | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) rename .github/workflows/{nodejs.yml => ci.yml} (68%) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/ci.yml similarity index 68% rename from .github/workflows/nodejs.yml rename to .github/workflows/ci.yml index 9f26941ec..40a114496 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,8 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Cache node modules + - name: Cache node modules (mac/linux) + if: !startsWith(matrix.os, 'windows') uses: actions/cache@preview with: path: ~/.cache/yarn @@ -34,6 +35,15 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- + - name: Cache node modules (windows) + if: startsWith(matrix.os, 'windows') + uses: actions/cache@preview + with: + path: ~/.cache/yarn + key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '\\yarn.lock')) }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies run: yarn From 88b467c39927ec72b549643f8fe7e2273a897275 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:03:57 +0800 Subject: [PATCH 11/17] xD --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40a114496..9cc3584ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Cache node modules (mac/linux) - if: !startsWith(matrix.os, 'windows') + if: startsWith(matrix.os, 'windows') == false uses: actions/cache@preview with: path: ~/.cache/yarn From de9a2c12686365b2740b090d8c62f93146f6937b Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:05:15 +0800 Subject: [PATCH 12/17] welp --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cc3584ba..8a0555c76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: uses: actions/cache@preview with: path: ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '\\yarn.lock')) }} + key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }} restore-keys: | ${{ runner.os }}-yarn- From f34490af7f5dcd7503ae900880ffd51202d9cb06 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:13:17 +0800 Subject: [PATCH 13/17] test --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a0555c76..c9e0f31d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,9 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: list files + run: node -e "console.log(fs.readdirSync('./'))" + - name: Cache node modules (mac/linux) if: startsWith(matrix.os, 'windows') == false uses: actions/cache@preview From 845478a9e3a15c9b094d8e52f8a4ea5dc080ba4c Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:15:53 +0800 Subject: [PATCH 14/17] test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9e0f31d8..c997bc898 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: list files - run: node -e "console.log(fs.readdirSync('./'))" + run: node -e "console.log(fs.readdirSync('./'), process.cwd())" - name: Cache node modules (mac/linux) if: startsWith(matrix.os, 'windows') == false From 7820c0e1b60e431e9a410844a3bd356066f372d3 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:18:57 +0800 Subject: [PATCH 15/17] try using a relative path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c997bc898..b11cbbba2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: uses: actions/cache@preview with: path: ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '\yarn.lock')) }} + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- From ff08320388b165b8e105038c63c9a31a34cc4e81 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:21:10 +0800 Subject: [PATCH 16/17] cannot get cache working, gg --- .github/workflows/ci.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b11cbbba2..26e60bcc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,27 +26,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: list files - run: node -e "console.log(fs.readdirSync('./'), process.cwd())" - - - name: Cache node modules (mac/linux) - if: startsWith(matrix.os, 'windows') == false - uses: actions/cache@preview - with: - path: ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Cache node modules (windows) - if: startsWith(matrix.os, 'windows') - uses: actions/cache@preview - with: - path: ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies run: yarn From 18d8445c0519e513610c69ed31aa26a65a5f0c64 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Sat, 2 Nov 2019 17:31:56 +0800 Subject: [PATCH 17/17] fix line ending --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 176a458f9..6313b56c5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -* text=auto +* text=auto eol=lf