Skip to content

Commit a82add6

Browse files
authored
Merge pull request #32 from WTW-IM/gh-actions
Build: replace travis pipeline with gha
2 parents 57d49c9 + 9c45a86 commit a82add6

File tree

2 files changed

+66
-21
lines changed

2 files changed

+66
-21
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- react-16
8+
jobs:
9+
test:
10+
name: "Test with Node version: ${{ matrix.node }}"
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: [ node, lts/* ]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node }}
23+
cache: npm
24+
25+
- name: Install Dependencies
26+
run: npm ci
27+
28+
- name: Run Lint
29+
run: npm run lint
30+
31+
- name: Run Build
32+
run: npm run build
33+
34+
- name: Run Jest
35+
run: npx jest
36+
publish:
37+
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/react-16' }}
38+
needs: [test]
39+
name: Publish NPM Package
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v3
44+
with:
45+
token: ${{ secrets.PIPELINE_BOT_PAT }}
46+
47+
- name: Setup Node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: ${{ matrix.node }}
51+
cache: npm
52+
53+
- name: Install Dependencies
54+
run: npm ci
55+
56+
- name: Set Commitbot Identity
57+
run: |
58+
git config user.name "React-HTML-Element Publish Bot"
59+
git config user.email "[email protected]"
60+
61+
- name: Semantic Release
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
65+
run: npx semantic-release
66+

.travis.yml

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

0 commit comments

Comments
 (0)