Skip to content

Commit a58dbb8

Browse files
committed
chore: Use github actions
1 parent 5decc0d commit a58dbb8

File tree

5 files changed

+148
-2258
lines changed

5 files changed

+148
-2258
lines changed

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
DEFAULT_NODE_VERSION: 14
11+
12+
jobs:
13+
tests:
14+
name: Unit tests
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [10.x, 12.x, 14.x, 15.x]
20+
webpack-version: [default, ^5.0.0]
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Setup Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
31+
- name: Cache node_modules
32+
uses: actions/cache@v2
33+
id: cache-nodemodules
34+
with:
35+
path: node_modules
36+
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
37+
38+
- name: Install dependencies
39+
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
40+
run: yarn install --frozen-lockfile --non-interactive
41+
42+
- name: Install webpack
43+
if: ${{ matrix.webpack-version != 'default' && steps.cache-nodemodules.outputs.cache-hit != 'true' }}
44+
run: yarn add --dev webpack@${{ matrix.webpack-version }}
45+
46+
- name: Unit tests
47+
run: yarn test --ci
48+
49+
lint:
50+
name: Lint
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
57+
- name: Setup Node.js
58+
uses: actions/setup-node@v2
59+
with:
60+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
61+
62+
- name: Cache node_modules
63+
uses: actions/cache@v2
64+
id: cache-nodemodules
65+
with:
66+
path: node_modules
67+
key: ${{ runner.os }}-${{ env.DEFAULT_NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
68+
69+
- name: Install dependencies
70+
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
71+
run: yarn install --frozen-lockfile --non-interactive
72+
73+
- name: Lint
74+
run: yarn lint
75+
76+
release:
77+
needs: [tests, lint]
78+
if: ${{ github.ref == 'refs/heads/main' }}
79+
name: Release
80+
runs-on: ubuntu-latest
81+
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v2
85+
with:
86+
fetch-depth: 0
87+
88+
- name: Setup Node.js
89+
uses: actions/setup-node@v2
90+
with:
91+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
92+
93+
- name: Release
94+
run: npx semantic-release --branches main
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
[![npm][npm]][npm-url]
2-
[![deps][deps]][deps-url]
3-
[![test][test]][test-url]
4-
[![chat][chat]][chat-url]
52

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

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

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

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

320317
[npm]: https://img.shields.io/npm/v/grunt-webpack.svg
321318
[npm-url]: https://npmjs.com/package/grunt-webpack
322-
323-
[deps]: https://david-dm.org/webpack-contrib/grunt-webpack.svg
324-
[deps-url]: https://david-dm.org/webpack-contrib/grunt-webpack
325-
326-
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
327-
[chat-url]: https://gitter.im/webpack/webpack
328-
329-
[test]: https://travis-ci.org/webpack-contrib/grunt-webpack.svg?branch=master
330-
[test-url]: https://travis-ci.org/webpack-contrib/grunt-webpack

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"grunt": "^1.2.1",
4747
"jest": "^26.1.0",
4848
"prettier": "^2.0.5",
49-
"semantic-release": "^17.1.1",
5049
"webpack": "^4.17.1"
5150
},
5251
"dependencies": {

0 commit comments

Comments
 (0)