From ddf4b1ee7d0f5b0d024d5243c69905de3389596b Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 4 Dec 2020 17:25:26 -0800 Subject: [PATCH 1/2] Migrate to GitHub Actions and update installation instructions. --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ .gitignore | 2 +- .travis.yml | 22 ---------------------- README.md | 4 ++-- 4 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e2972ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: purescript-contrib/setup-purescript@main + with: + purescript: "0.14.0-rc3" + + - uses: actions/setup-node@v1 + with: + node-version: "12" + + - name: Install dependencies + run: | + npm install -g bower + npm install + bower install --production + + - name: Build source + run: npm run-script build + + - name: Run tests + run: | + bower install + npm run-script test --if-present diff --git a/.gitignore b/.gitignore index 21904d5..84a2dff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ !/.gitignore !/.jscsrc !/.jshintrc -!/.travis.yml +!/.github/ /bower_components/ /node_modules/ /output/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3abe5e7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js -dist: trusty -sudo: required -node_js: 6 -env: - - PATH=$HOME/purescript:$PATH -install: - # - TAG=$(basename $(curl --location --silent --output /dev/null -w %{url_effective} https://github.com/purescript/purescript/releases/latest)) - - TAG=v0.14.0-rc3 - - curl --location --output $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz - - tar -xvf $HOME/purescript.tar.gz -C $HOME/ - - chmod a+x $HOME/purescript - - npm install -g bower - - npm install - - bower install -script: - - npm run -s build -after_success: -- >- - test $TRAVIS_TAG && - echo $GITHUB_TOKEN | pulp login && - echo y | pulp publish --no-push diff --git a/README.md b/README.md index 608114d..3a33c5d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # purescript-math [![Latest release](http://img.shields.io/bower/v/purescript-math.svg)](https://github.com/purescript/purescript-math/releases) -[![Build Status](https://travis-ci.org/purescript/purescript-math.svg?branch=master)](https://travis-ci.org/purescript/purescript-math) +[![Build status](https://github.com/purescript/purescript-math/workflows/CI/badge.svg?branch=master)](https://github.com/purescript/purescript-math/actions?query=workflow%3ACI+branch%3Amaster) Standard math functions from JavaScript. ## Installation ``` -bower install purescript-math +spago install math ``` ## Documentation From 3e53c5c62caec634bf61da1489df36b12dfc6c60 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Mon, 7 Dec 2020 21:10:00 -0800 Subject: [PATCH 2/2] Switch to eslint and update ci --- .eslintrc.json | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 6 +++++- .gitignore | 3 +-- .jscsrc | 17 ----------------- .jshintrc | 20 -------------------- README.md | 3 ++- package.json | 7 +++---- 7 files changed, 39 insertions(+), 45 deletions(-) create mode 100644 .eslintrc.json delete mode 100644 .jscsrc delete mode 100644 .jshintrc diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..84cef4f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "parserOptions": { + "ecmaVersion": 5 + }, + "extends": "eslint:recommended", + "env": { + "commonjs": true + }, + "rules": { + "strict": [2, "global"], + "block-scoped-var": 2, + "consistent-return": 2, + "eqeqeq": [2, "smart"], + "guard-for-in": 2, + "no-caller": 2, + "no-extend-native": 2, + "no-loop-func": 2, + "no-new": 2, + "no-param-reassign": 2, + "no-return-assign": 2, + "no-unused-expressions": 2, + "no-use-before-define": 2, + "radix": [2, "always"], + "indent": [2, 2], + "quotes": [2, "double"], + "semi": [2, "always"] + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2972ba..55efa3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI -on: push +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: build: diff --git a/.gitignore b/.gitignore index 84a2dff..b846b63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ /.* !/.gitignore -!/.jscsrc -!/.jshintrc +!/.eslintrc.json !/.github/ /bower_components/ /node_modules/ diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 2561ce9..0000000 --- a/.jscsrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "preset": "grunt", - "disallowSpacesInFunctionExpression": null, - "requireSpacesInFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInAnonymousFunctionExpression": null, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInsideObjectBrackets": null, - "requireSpacesInsideObjectBrackets": "all", - "validateQuoteMarks": "\"", - "requireCurlyBraces": null -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 620d8d7..0000000 --- a/.jshintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "bitwise": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "funcscope": true, - "futurehostile": true, - "strict": "global", - "latedef": true, - "maxparams": 1, - "noarg": true, - "nocomma": true, - "nonew": true, - "notypeof": true, - "singleGroups": true, - "undef": true, - "unused": true, - "eqnull": true, - "predef": ["exports"] -} diff --git a/README.md b/README.md index 3a33c5d..cc84c53 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # purescript-math -[![Latest release](http://img.shields.io/bower/v/purescript-math.svg)](https://github.com/purescript/purescript-math/releases) +[![Latest release](http://img.shields.io/github/release/purescript/purescript-math.svg)](https://github.com/purescript/purescript-math/releases) [![Build status](https://github.com/purescript/purescript-math/workflows/CI/badge.svg?branch=master)](https://github.com/purescript/purescript-math/actions?query=workflow%3ACI+branch%3Amaster) +[![Pursuit](https://pursuit.purescript.org/packages/purescript-math/badge)](https://pursuit.purescript.org/packages/purescript-math) Standard math functions from JavaScript. diff --git a/package.json b/package.json index 1c428e6..1c67b54 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,12 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "jshint src && jscs src && pulp build -- --censor-lib --strict" + "build": "eslint src && pulp build -- --censor-lib --strict" }, "devDependencies": { - "jscs": "^3.0.7", - "jshint": "^2.9.5", + "eslint": "^7.15.0", "pulp": "^15.0.0", "purescript-psa": "^0.8.0", - "rimraf": "^2.6.2" + "rimraf": "^3.0.2" } }