Skip to content

Commit ca5a0d2

Browse files
feat(github-actions): add github action job definition
1 parent 7fb09a0 commit ca5a0d2

File tree

2 files changed

+52
-27
lines changed

2 files changed

+52
-27
lines changed

.github/workflows/ci.yml

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

.github/workflows/main.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Node CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/[email protected]
11+
- name: Install Node v12
12+
uses: actions/setup-node@v2-beta
13+
with:
14+
node-version: 12
15+
- uses: actions/cache@v2
16+
with:
17+
path: ~/.npm
18+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
19+
restore-keys: |
20+
${{ runner.os }}-node-
21+
- name: npm install, build, and test
22+
run: |
23+
npm install
24+
npm run lint:ci
25+
npm run test:ci
26+
npm run build
27+
npm run docs:build
28+
env:
29+
CI: true
30+
# release for master branch
31+
release:
32+
if: ${{ github.ref == 'master' }}
33+
needs: build
34+
35+
steps:
36+
- name: Echo
37+
run:
38+
echo "release because we are on master branch"
39+
40+
# release for PR branch
41+
releasePr:
42+
if: ${{ startsWith(github.ref, 'refs/pull/') }}
43+
needs: build
44+
45+
steps:
46+
- name: Echo
47+
run:
48+
echo "pre-release because we are on a pull request"
49+
- name: Publish
50+
run: |
51+
npm run-report coverage
52+
npx semantic-release

0 commit comments

Comments
 (0)