Skip to content

Commit 06dba1e

Browse files
Switched from Travis CI to GitHub Actions
1 parent f7027ce commit 06dba1e

File tree

3 files changed

+110
-44
lines changed

3 files changed

+110
-44
lines changed

.github/workflows/CI-CD.yaml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# GitHub Actions workflow
2+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
3+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
4+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
5+
6+
name: CI-CD
7+
8+
on:
9+
push:
10+
branches:
11+
- "*"
12+
tags-ignore:
13+
- "*"
14+
15+
schedule:
16+
- cron: "0 0 1 * *"
17+
18+
jobs:
19+
test:
20+
name: Node ${{ matrix.node }} on ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
strategy:
24+
fail-fast: true
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- macos-latest
29+
- windows-latest
30+
node:
31+
- 10
32+
- 12
33+
34+
steps:
35+
- name: Checkout source
36+
uses: actions/checkout@v2
37+
38+
- name: Install Node ${{ matrix.node }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- name: Install dependencies
44+
run: npm ci
45+
46+
- name: Run linters
47+
run: npm run lint
48+
49+
- name: Build the code
50+
run: npm run build
51+
52+
- name: Run tests
53+
run: npm run coverage
54+
55+
- name: Send code coverage results to Coveralls
56+
uses: coverallsapp/github-action@v1.0.1
57+
with:
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
parallel: true
60+
61+
coverage:
62+
name: Code Coverage
63+
runs-on: ubuntu-latest
64+
timeout-minutes: 10
65+
needs: test
66+
steps:
67+
- name: Let Coveralls know that all tests have finished
68+
uses: coverallsapp/github-action@v1.0.1
69+
with:
70+
github-token: ${{ secrets.GITHUB_TOKEN }}
71+
parallel-finished: true
72+
73+
deploy:
74+
name: Publish to NPM
75+
if: github.ref == 'refs/heads/master'
76+
runs-on: ubuntu-latest
77+
timeout-minutes: 10
78+
needs: test
79+
80+
steps:
81+
- name: Checkout source
82+
uses: actions/checkout@v2
83+
84+
- name: Install Node
85+
uses: actions/setup-node@v1
86+
87+
- name: Install dependencies
88+
run: npm ci
89+
90+
- name: Build the code
91+
run: npm run build
92+
93+
- name: Publish to NPM
94+
uses: JS-DevTools/npm-publish@v1
95+
with:
96+
token: ${{ secrets.NPM_TOKEN }}
97+
98+
- name: Prepare the non-scoped packaged
99+
run: |
100+
cp LICENSE *.md dist
101+
VERSION=$(node -e "console.log(require('./package.json').version)")
102+
sed -i "s/X.X.X/${VERSION}/g" dist/package.json
103+
104+
- name: Publish the non-scoped package to NPM
105+
uses: JS-DevTools/npm-publish@v1
106+
with:
107+
token: ${{ secrets.NPM_TOKEN }}
108+
package: dist/package.json

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Istanbul code coverage loader for Webpack
22
==============================================
33

4-
[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://travis-ci.com/JS-DevTools/coverage-istanbul-loader)
5-
[![Build Status](https://api.travis-ci.com/JS-DevTools/coverage-istanbul-loader.svg?branch=master)](https://travis-ci.com/JS-DevTools/coverage-istanbul-loader)
4+
[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/coverage-istanbul-loader/blob/master/.github/workflows/CI-CD.yaml)
5+
[![Build Status](https://github.com/JS-DevTools/coverage-istanbul-loader/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/coverage-istanbul-loader/blob/master/.github/workflows/CI-CD.yaml)
66

77
[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/coverage-istanbul-loader/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/coverage-istanbul-loader?branch=master)
88
[![Dependencies](https://david-dm.org/JS-DevTools/coverage-istanbul-loader.svg)](https://david-dm.org/JS-DevTools/coverage-istanbul-loader)

0 commit comments

Comments
 (0)