From 83992f81b5397b18563d82a6d4b904a2b9da054c Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 00:49:31 -0500 Subject: [PATCH 1/7] remove travis --- .travis.yml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 275057702c..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: node_js - -jobs: - fast_finish: true - allow_failures: - - stage: security scan 🔐 - - include: - - stage: unit tests 👩🏽‍💻 - script: npm run test:unit - node_js: lts/* - - - stage: spec tests 👩🏽‍💻 - script: npm run test:specs - node_js: lts/* - - node_js: node - - - stage: lint ✨ - script: npm run test:lint - node_js: lts/* - - - stage: build 🗜️ - script: | - npm run build - if ! git diff --quiet; then - git config --global user.email "<>" - git config --global user.name "MarkedJS bot" - git config credential.helper "store --file=.git/credentials" - echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials - git commit -am '🗜️ build [skip ci]' - git push origin HEAD:${TRAVIS_BRANCH} - fi - node_js: lts/* - if: branch = master AND type = push - - # - stage: security scan 🔐 - # script: npm run test:redos - # node_js: lts/* - -cache: - directories: - - node_modules - -git: - depth: 3 From a8389b2d08d683009f57badccf5bcae04b43c9ec Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 00:49:41 -0500 Subject: [PATCH 2/7] add github action --- .github/workflows/tests.yml | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..5b2820b582 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,68 @@ +name: "Tests" +on: + pull_request: + push: + branches: + - master + +jobs: + Test: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + strategy: + matrix: + node_version: ['lts/*', 'node'] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Install Node + run: nvm ${{ matrix.node_version }} + - name: Install Dependencies + run: npm ci + - name: Run Unit Tests + run: npm run test:unit + - name: Run Spec Tests + run: npm run test:spec + + Lint: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Install Node + run: nvm lts/* + - name: Install Dependencies + run: npm ci + - name: Lint ✨ + run: npm run test:lint + + Build: + needs: [Test, Lint] + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Install Node + run: nvm lts/* + - name: Install Dependencies + run: npm ci + - name: Build 🧱 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npm run build + if ! git diff --quiet -- dist ; then + git config --global user.email "<>" + git config --global user.name "GitHub Actions" + git commit -m 'chore(build): 🧱 build [skip ci]' --no-verify -- dist + git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/markedjs/marked.git" HEAD:master + fi + + Skip: + if: contains(github.event.head_commit.message, '[skip ci]') + runs-on: ubuntu-latest + steps: + - name: Skip CI 🚫 + run: echo skip ci From 06968a8a14ffcbf171cac2242069c04d11b9008c Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 00:53:50 -0500 Subject: [PATCH 3/7] update readme badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e93504ca93..7f6f0bd9e1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked) [![dep](https://badgen.net/david/dep/markedjs/marked?label=deps)](https://david-dm.org/markedjs/marked) [![dev dep](https://badgen.net/david/dev/markedjs/marked?label=devDeps)](https://david-dm.org/markedjs/marked?type=dev) -[![travis](https://badgen.net/travis/markedjs/marked)](https://travis-ci.org/markedjs/marked) +[![github actions](https://github.com/markedjs/marked/workflows/Tests/badge.svg)](https://github.com/markedjs/marked/actions) [![snyk](https://snyk.io/test/npm/marked/badge.svg)](https://snyk.io/test/npm/marked) - ⚡ built for speed From fd18ca5c5f4052106752d14b331b6f39ec08a95c Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 10:20:50 -0500 Subject: [PATCH 4/7] use setup-node-nvm --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b2820b582..ab8de2660c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,9 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 - name: Install Node - run: nvm ${{ matrix.node_version }} + uses: dcodeIO/setup-node-nvm@master + with: + node-version: ${{ matrix.node_version }} - name: Install Dependencies run: npm ci - name: Run Unit Tests From e4bde9b9ed0365c9cd29cb55d30c51579a68fb54 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 10:23:14 -0500 Subject: [PATCH 5/7] fix test:specs --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab8de2660c..c745a1b903 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: - name: Run Unit Tests run: npm run test:unit - name: Run Spec Tests - run: npm run test:spec + run: npm run test:specs Lint: if: "!contains(github.event.head_commit.message, '[skip ci]')" @@ -32,8 +32,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v2 - - name: Install Node - run: nvm lts/* - name: Install Dependencies run: npm ci - name: Lint ✨ From ae5315891af93c06dda71c3a2543ae10c5ad5894 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 10:29:21 -0500 Subject: [PATCH 6/7] fix build --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c745a1b903..29c5efb0bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,10 +53,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | npm run build - if ! git diff --quiet -- dist ; then + if ! git diff --quiet; then git config --global user.email "<>" - git config --global user.name "GitHub Actions" - git commit -m 'chore(build): 🧱 build [skip ci]' --no-verify -- dist + git config --global user.name "MarkedJS bot" + git commit -am "🗜️ build [skip ci]" git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/markedjs/marked.git" HEAD:master fi From bcc1049a201e09d0b49f74b699dd96f7ef306fbf Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 1 Apr 2020 10:42:45 -0500 Subject: [PATCH 7/7] make pretty --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 29c5efb0bd..28251d340d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,9 +21,9 @@ jobs: node-version: ${{ matrix.node_version }} - name: Install Dependencies run: npm ci - - name: Run Unit Tests + - name: Run Unit Tests 👩🏽‍💻 run: npm run test:unit - - name: Run Spec Tests + - name: Run Spec Tests 👩🏽‍💻 run: npm run test:specs Lint: @@ -48,7 +48,7 @@ jobs: run: nvm lts/* - name: Install Dependencies run: npm ci - - name: Build 🧱 + - name: Build 🗜️ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: |