From 05dd46dc9234ef9fd9fd4fbbc2aae842a4af6304 Mon Sep 17 00:00:00 2001 From: Glen Cheney Date: Wed, 26 Jan 2022 00:00:23 -0800 Subject: [PATCH] Migrate to github actions (#378) * Migrate to github actions * Remove `ci`. Forgot I removed the lockfile. * Use `compile` instead of `build` so that tests aren't run twice * Update build badge --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .travis.yml | 4 ---- README.md | 7 ++----- package.json | 5 ++++- 4 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..22623f0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm install + - name: Lint files + run: npm run lint + - name: Build bundle + run: npm run compile + - name: Run unit tests + run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ef3618b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - '12' - - '14' diff --git a/README.md b/README.md index b4fc955..52cdf25 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [Shuffle][homepage] [![Build Status][travis-img]][travis-url] [![Dependency Status][david-img]][david-url] [![Dependabot Status][dependabot-img]][dependabot-url] [![NPM version][npm-img]][npm-url] +# [Shuffle][homepage] ![Build Status][actions-img] [![Dependabot Status][dependabot-img]][dependabot-url] [![NPM version][npm-img]][npm-url] Categorize, sort, and filter a responsive grid of items. @@ -26,10 +26,7 @@ const shuffleInstance = new Shuffle(document.getElementById('grid'), { This project was inspired by [Isotope](http://isotope.metafizzy.co/) and [Packery](http://packery.metafizzy.co/). [homepage]: https://vestride.github.io/Shuffle/ -[travis-url]: https://travis-ci.com/Vestride/Shuffle -[travis-img]: https://travis-ci.com/Vestride/Shuffle.svg?branch=main -[david-url]: https://david-dm.org/Vestride/Shuffle -[david-img]: https://david-dm.org/Vestride/Shuffle.svg +[actions-img]: https://github.com/Vestride/Shuffle/actions/workflows/build.yml/badge.svg?branch=main [npm-url]: https://www.npmjs.com/package/shufflejs [npm-img]: https://img.shields.io/npm/v/shufflejs.svg [dependabot-url]: https://docs.github.com/en/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates diff --git a/package.json b/package.json index 5eb6728..7a2183e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,10 @@ "gulp": "gulp", "build": "npm run gulp && npm run css", "serve": "gulp jekyll", - "test": "eslint src && jest && tsc --project ./test/types", + "test-all": "npm run lint && npm test && npm run type-check", + "test": "jest", + "lint": "eslint src", + "type-check": "tsc --project ./test/types", "watch": "gulp watch" }, "repository": {