From 34f502c166dba5e1f90413d8cd2ef32485255f1a Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Thu, 10 Jun 2021 12:22:04 +0800 Subject: [PATCH 1/4] Add test and build actions Signed-off-by: Yukai Huang --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..ea8420facb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: 'Test and Build' + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + test-and-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - uses: actions/setup-node@v2 + with: + node-version: '12' + check-latest: true + + - run: npm ci + - run: npm run test:ci + - run: npm run build From 71dce28c0437f6a9a93af786507d126b0f02364b Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Thu, 10 Jun 2021 12:44:30 +0800 Subject: [PATCH 2/4] Add doctoc check Signed-off-by: Yukai Huang --- .github/workflows/build.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea8420facb..c0e2f61c8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,10 @@ on: jobs: test-and-build: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x] + steps: - uses: actions/checkout@v2 @@ -19,10 +23,29 @@ jobs: ${{ runner.os }}-node- - uses: actions/setup-node@v2 + name: Use Node.js ${{ matrix.node-version }} with: - node-version: '12' + node-version: ${{ matrix.node-version }} check-latest: true - run: npm ci - run: npm run test:ci - run: npm run build + + doctoc: + needs: test-and-build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' || github.event.pull_request + + steps: + - uses: actions/setup-node@v2 + name: Use Node.js 12 + with: + node-version: 12 + check-latest: true + - name: Install doctoc-check + run: | + npm install -g doctoc + cp README.md README.md.orig + npm run doctoc + diff -q README.md README.md.orig From 24323975c7ec5fe2945a19613f39d54a5e5afe53 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Thu, 10 Jun 2021 12:51:42 +0800 Subject: [PATCH 3/4] Fix doctoc workflow Signed-off-by: Yukai Huang --- .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 c0e2f61c8c..497acc866f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,11 +33,11 @@ jobs: - run: npm run build doctoc: - needs: test-and-build runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' || github.event.pull_request steps: + - uses: actions/checkout@v2 - uses: actions/setup-node@v2 name: Use Node.js 12 with: From dcfdb0129cd164f81f12eb6674c20509d68210af Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Thu, 10 Jun 2021 12:52:13 +0800 Subject: [PATCH 4/4] Remove travis CI config Signed-off-by: Yukai Huang --- .travis.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2015bd71a6..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: node_js - -node_js: - - "lts/dubnium" - - "11" - - "12" - -dist: xenial -cache: npm - -matrix: - fast_finish: true - include: - - node_js: lts/dubnium - allow_failures: - - node_js: "11" - - node_js: "12" - -script: - - npm run test:ci - - npm run build - -jobs: - include: - - stage: doctoc-check - install: npm install -g doctoc - if: type = pull_request OR branch = master - script: - - cp README.md README.md.orig - - npm run doctoc - - diff -q README.md README.md.orig - node_js: lts/carbon