Skip to content

Commit

Permalink
chore: Use github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Apr 18, 2021
1 parent 5decc0d commit a58dbb8
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 2,258 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
push:
branches:
- main
pull_request:

env:
DEFAULT_NODE_VERSION: 14

jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
webpack-version: [default, ^5.0.0]

steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Cache node_modules
uses: actions/cache@v2
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
run: yarn install --frozen-lockfile --non-interactive

- name: Install webpack
if: ${{ matrix.webpack-version != 'default' && steps.cache-nodemodules.outputs.cache-hit != 'true' }}
run: yarn add --dev webpack@${{ matrix.webpack-version }}

- name: Unit tests
run: yarn test --ci

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

- name: Cache node_modules
uses: actions/cache@v2
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-${{ env.DEFAULT_NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
run: yarn install --frozen-lockfile --non-interactive

- name: Lint
run: yarn lint

release:
needs: [tests, lint]
if: ${{ github.ref == 'refs/heads/main' }}
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

- name: Release
run: npx semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[![npm][npm]][npm-url]
[![deps][deps]][deps-url]
[![test][test]][test-url]
[![chat][chat]][chat-url]

<div align="center">
<!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->
Expand All @@ -17,7 +14,7 @@

<h2 align="center">Requirements</h2>

- Version 4 of `grunt-webpack` supports webpack 4 as well as version 5 beta.
- Version 4 of `grunt-webpack` supports webpack version 4 and 5.
- Version 3.2.0 of `webpack-dev-server` is needed if used (optional).

<h2 align="center">Install</h2>
Expand Down Expand Up @@ -319,12 +316,3 @@ module.exports = function(grunt) {

[npm]: https://img.shields.io/npm/v/grunt-webpack.svg
[npm-url]: https://npmjs.com/package/grunt-webpack

[deps]: https://david-dm.org/webpack-contrib/grunt-webpack.svg
[deps-url]: https://david-dm.org/webpack-contrib/grunt-webpack

[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
[chat-url]: https://gitter.im/webpack/webpack

[test]: https://travis-ci.org/webpack-contrib/grunt-webpack.svg?branch=master
[test-url]: https://travis-ci.org/webpack-contrib/grunt-webpack
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"grunt": "^1.2.1",
"jest": "^26.1.0",
"prettier": "^2.0.5",
"semantic-release": "^17.1.1",
"webpack": "^4.17.1"
},
"dependencies": {
Expand Down

0 comments on commit a58dbb8

Please sign in to comment.