Skip to content

Commit e22d6db

Browse files
authored
chore: set up GH Actions as CI (#190)
1 parent 9fe0b70 commit e22d6db

File tree

5 files changed

+104
-83
lines changed

5 files changed

+104
-83
lines changed

.github/workflows/node.js.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test-node:
13+
name: Test on Node.js v${{ matrix.node-version }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 15.x]
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
- name: Get yarn cache directory path
25+
id: yarn-cache-dir-path
26+
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
- uses: actions/cache@v2
28+
id: yarn-cache
29+
with:
30+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-yarn-
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v2
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
- run: yarn
39+
- name: run tests
40+
run: yarn travis
41+
- uses: codecov/codecov-action@v1
42+
test-os:
43+
name: Test on ${{ matrix.os }} using Node.js LTS
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
os: [ubuntu-latest, windows-latest, macOS-latest]
48+
runs-on: ${{ matrix.os }}
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
- name: Get yarn cache directory path
53+
id: yarn-cache-dir-path
54+
run: echo "::set-output name=dir::$(yarn cache dir)"
55+
- uses: actions/cache@v2
56+
id: yarn-cache
57+
with:
58+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
59+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
60+
restore-keys: |
61+
${{ runner.os }}-yarn-
62+
- uses: actions/[email protected]
63+
with:
64+
node-version: 14.x
65+
- run: yarn
66+
- name: run tests
67+
run: yarn travis
68+
69+
release:
70+
if:
71+
# prettier-ignore
72+
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
73+
name: Release new version
74+
needs: [test-node, test-os]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v2
78+
with:
79+
fetch-depth: 0
80+
- name: Get yarn cache directory path
81+
id: yarn-cache-dir-path
82+
run: echo "::set-output name=dir::$(yarn cache dir)"
83+
- uses: actions/cache@v2
84+
id: yarn-cache
85+
with:
86+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
87+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
88+
restore-keys: |
89+
${{ runner.os }}-yarn-
90+
- uses: actions/setup-node@v2
91+
with:
92+
node-version: 14.x
93+
- name: install
94+
run: yarn
95+
- run: npx semantic-release@15
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.hound.yml

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

.travis.yml

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

README.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
> Add a JavaScript or CSS asset to the HTML generated by `html-webpack-plugin`
44
55
[![NPM Version][npm-image]][npm-url]
6-
[![Linux & Mac Build Status][travis-image]][travis-url]
7-
[![Windows Build Status][appveyor-image]][appveyor-url]
6+
[![CI Build Status][gh-actions-image]][gh-actions-url]
87
[![Code Coverage branch][codecov-image]][codecov-url]
98

109
[![Dependency Status][david-image]][david-url]
1110
[![Dev Dependency Status][david-dev-image]][david-dev-url]
1211
[![Peer Dependency Status][david-peer-image]][david-peer-url]
13-
[![Greenkeeper Dependency Status][greenkeeper-image]][greenkeeper-url]
1412

1513
## Installation
1614

@@ -58,7 +56,7 @@ look like:
5856
<!DOCTYPE html>
5957
<html>
6058
<head>
61-
<meta charset="UTF-8">
59+
<meta charset="UTF-8" />
6260
<title>Webpack App</title>
6361
</head>
6462
<body>
@@ -248,13 +246,10 @@ const webpackConfig = {
248246

249247
[npm-url]: https://npmjs.org/package/add-asset-html-webpack-plugin
250248
[npm-image]: https://img.shields.io/npm/v/add-asset-html-webpack-plugin.svg
251-
[travis-url]: https://travis-ci.org/SimenB/add-asset-html-webpack-plugin
252-
[travis-image]:
253-
https://img.shields.io/travis/SimenB/add-asset-html-webpack-plugin/master.svg
254-
[appveyor-url]:
255-
https://ci.appveyor.com/project/SimenB/add-asset-html-webpack-plugin
256-
[appveyor-image]:
257-
https://ci.appveyor.com/api/projects/status/dim5hcl49h3pi332/branch/master?svg=true
249+
[gh-actions-url]:
250+
https://github.com/SimenB/add-asset-html-webpack-plugin/actions/workflows/node.js.yml
251+
[gh-actions-image]:
252+
https://github.com/SimenB/add-asset-html-webpack-plugin/actions/workflows/node.js.yml/badge.svg?branch=main
258253
[codecov-url]: https://codecov.io/gh/SimenB/add-asset-html-webpack-plugin
259254
[codecov-image]:
260255
https://img.shields.io/codecov/c/github/SimenB/add-asset-html-webpack-plugin/master.svg
@@ -269,6 +264,3 @@ const webpackConfig = {
269264
https://david-dm.org/SimenB/add-asset-html-webpack-plugin?type=peer
270265
[david-peer-image]:
271266
https://img.shields.io/david/peer/SimenB/add-asset-html-webpack-plugin.svg
272-
[greenkeeper-url]: https://greenkeeper.io/
273-
[greenkeeper-image]:
274-
https://badges.greenkeeper.io/SimenB/add-asset-html-webpack-plugin.svg

appveyor.yml

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

0 commit comments

Comments
 (0)