From a511f923d17da81e5b829b9b666d7f9dadd773bf Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Sun, 19 Dec 2021 01:13:26 +0100 Subject: [PATCH] Replace Travis with GitHub action --- .github/workflows/test.yml | 47 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 12 ---------- 2 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b87c873 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: ๐Ÿงช Test + +on: + push: + branches: + - "master" + pull_request: {} + +jobs: + test: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x, 16.x] + + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # pin@0.9.1 + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2 + - name: โŽ” Setup node ${{ matrix.node-version }} + uses: actions/setup-node@25316bbc1f10ac9d8798711f44914b1cf3c4e954 # pin@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - name: ๐Ÿ—„ Cache node_modules + id: cache-node_modules + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 + with: + path: "**/node_modules" + key: node_modules-${{ runner.os }}-node-${{ matrix.node-version }}-${{ + hashFiles('**/package-lock.json') }} + - name: ๐Ÿ“ฅ Install dependencies + if: steps.cache-node_modules.outputs.cache-hit != 'true' + run: | + npm ci --ignore-scripts + - name: ๐Ÿงช Test + run: | + npm test + env: + CI: true + - name: โฌ†๏ธ Upload coverage report + uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # pin@1.1.3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f6e6abb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "8" - - "10" - - "12" - -script: - - npm test -after_success: - - npm install -g istanbul - - npm install coveralls - - istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage