Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Github actions (#210)
  • Loading branch information
jamescryer committed Jun 20, 2021
1 parent e218e69 commit 63cfdd8
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 23 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Expand Up @@ -6,3 +6,4 @@ index.html
bower.json
README.md
coverage
.github
10 changes: 6 additions & 4 deletions .eslintignore
@@ -1,4 +1,6 @@
/node_modules
/libs
/demoassets
/coverage
./node_modules/**
**/node_modules/**
libs/**
demoassets/**
coverage/**
.github/**
85 changes: 85 additions & 0 deletions .github/workflows/node.js.yml
@@ -0,0 +1,85 @@
name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
codacy-analysis-cli:
name: Codacy Analysis CLI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@master

coverage:
runs-on: windows-latest
name: codacy-coverage-reporter
steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16

- name: Install Node.js dependencies
run: npm ci

- name: Test
run: npm run test:coverage

- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/lcov.info

lint:
name: Run linters
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16

- name: Install Node.js dependencies
run: npm ci --ignore-scripts

- name: Run linters
uses: wearerequired/lint-action@v1
with:
auto_fix: false
eslint: true
prettier: false

build:
runs-on: windows-latest

strategy:
matrix:
node-version: [12.x, 14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: npm ci

- name: Test
run: npm test
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
.idea
node_modules
coverage
coverage
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -11,3 +11,4 @@ dockerfile
.travis.yml
memory-leak-test.js
coverage
.github
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

12 changes: 8 additions & 4 deletions README.md
@@ -1,11 +1,15 @@
**Low-maintainance mode**: Two to four times a year the library author will spend some time to keep the library useful. Feel free to raise issues and contribute improvements, but please be aware that it may be sometime before a response is given.

---

<h1 align="center"><img src="https://raw.github.com/rsmbl/Resemble.js/master/demoassets/resemble.png" alt="Resemble.js" width="256"/></h1>

<p align="center">
<a href="https://travis-ci.org/rsmbl/Resemble.js"><img alt="Build Status" src="https://travis-ci.org/rsmbl/Resemble.js.svg?branch=master" /></a>
<a href="https://www.codacy.com/app/jamescryer/Resemble.js?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=rsmbl/Resemble.js&amp;utm_campaign=Badge_Grade"><img alt="Code Health" src="https://api.codacy.com/project/badge/Grade/1e0972581406417e9914bc58f57704b3" /></a>
<a href="https://www.codacy.com/app/jamescryer/Resemble.js?utm_source=github.com&utm_medium=referral&utm_content=rsmbl/Resemble.js&utm_campaign=Badge_Coverage"><img alt="Coverage" src="https://api.codacy.com/project/badge/Coverage/9223d8d37c99428c8c06b889470327a5" /></a>
<a href="https://opensource.org/licenses/MIT"><img alt="Build Status" src="https://img.shields.io/badge/License-MIT-yellow.svg" /></a>
<a href="https://github.com/rsmbl/Resemble.js/actions"><img alt="Build Status" src="(https://github.com/rsmbl/Resemble.js/actions/workflows/node.js.yml/badge.svg" /></a>
<a href="https://www.codacy.com/gh/rsmbl/Resemble.js/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=rsmbl/Resemble.js&amp;utm_campaign=Badge_Grade"><img alt="Code Health" src="https://app.codacy.com/project/badge/Grade/97c5e9c42bcf4b4bbc2271882f18c502" /></a>
<a href="https://opensource.org/licenses/MIT"><img alt="MIT License" src="https://img.shields.io/badge/License-MIT-yellow.svg" /></a>
<a href="https://www.npmjs.com/package/resemblejs"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/resemblejs.svg" /></a>

</p>

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion dockerfile
@@ -1,4 +1,4 @@
FROM node:12
FROM node:16

RUN apt-get update \
&& apt-get install -qq libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev build-essential g++
Expand Down
1 change: 1 addition & 0 deletions nodejs-tests/resemble.test.js
Expand Up @@ -172,6 +172,7 @@ describe("resemble", () => {
left: 20,
top: 200,
right: 350,

bottom: 250
}
]
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -23,10 +23,11 @@
"homepage": "https://github.com/rsmbl/Resemble.js",
"scripts": {
"test": "jest nodejs-tests",
"test:codacy-coverage": "jest nodejs-tests --coverage && cat ./coverage/lcov.info | codacy-coverage",
"test:coverage": "jest nodejs-tests --coverage",
"test:watch": "jest --watch nodejs-tests",
"test:debug": "node --inspect node_modules/jest/bin/jest --watch --runInBand nodejs-tests",
"lint": "eslint **/*.js --fix"
"lint": "eslint **/*.js --fix",
"lint-ci": "eslint -c ./.eslintrc --ignore-path ./.eslintignore **/*.js"
},
"husky": {
"hooks": {
Expand Down

0 comments on commit 63cfdd8

Please sign in to comment.