From e3862d8ecdea4d5980821b0a14170b9e1e061f71 Mon Sep 17 00:00:00 2001 From: Alexei KLENIN Date: Sun, 10 Jul 2022 17:26:15 +0200 Subject: [PATCH] Migrate from Travis to Github CI --- .editorconfig | 2 +- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 16 ------------ README.md | 2 +- 4 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.editorconfig b/.editorconfig index 67f8cf9..0693277 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,7 +13,7 @@ ij_visual_guides = 100 [*.js] ij_javascript_use_double_quotes = false -[*.json] +[{*.json, *.yml}] indent_size = 2 [*.md] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fee2c5d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + env: + node_version: 16.14.x + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node ${{ env.node_version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ env.node_version }} + + - name: Install + run: npm install + + - name: Compile + run: npm run compile + + - name: Test + run: npm test + + - name: Build + run: npm run build + + coverage: + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/master' + env: + node_version: 16.14.x + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node ${{ env.node_version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ env.node_version }} + + - name: Install + run: npm install + + - name: Report coverage + run: | + npm run test:ci + npm run coverage diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6debb93..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: node_js -node_js: - - 14 - -jobs: - include: - - stage: test - if: branch != master - install: "npm install" - script: "npm run test" - - - stage: test-with-coverage - if: branch = master - install: "npm install" - script: "npm run test:ci" - after_success: "npm run coverage" diff --git a/README.md b/README.md index 9ae1263..de23800 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Leaflet.SmoothMarkerBouncing [![npm](https://img.shields.io/npm/v/leaflet.smooth_marker_bouncing.svg)](http://npm.im/leaflet.smooth_marker_bouncing) -[![Build Status](https://travis-ci.org/hosuaby/Leaflet.SmoothMarkerBouncing.svg?branch=master)](https://travis-ci.org/hosuaby/Leaflet.SmoothMarkerBouncing) +[![CI](https://github.com/hosuaby/Leaflet.SmoothMarkerBouncing/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/hosuaby/Leaflet.SmoothMarkerBouncing/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/hosuaby/Leaflet.SmoothMarkerBouncing/badge.svg?branch=master)](https://coveralls.io/github/hosuaby/Leaflet.SmoothMarkerBouncing?branch=master)