Skip to content

Commit e5f79b3

Browse files
committed
fix(ci): add github actions
- add test action that will run on pull requests - add release action that will run on pushes to master - add semantic-release configuration file - add @semantic-release/github plugin - update semantic-release to latest version
1 parent 1b5c089 commit e5f79b3

File tree

5 files changed

+1151
-2535
lines changed

5 files changed

+1151
-2535
lines changed

.github/workflows/release.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release npm package
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@master
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: "14.x"
17+
18+
- name: npm install and build
19+
run:
20+
npm ci
21+
22+
- name: Pull docker image
23+
run: docker pull existdb/existdb:release
24+
25+
- name: Build docker image
26+
run: docker create --name exist-ci -p 8080:8080 -p 8443:8443 existdb/existdb:release
27+
28+
- name: Start docker image
29+
run: docker start exist-ci
30+
31+
- name: Wait for existdb startup
32+
run: sleep 30
33+
34+
- run: npm test
35+
- run: npx semantic-release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: test node-exist
2+
3+
on:
4+
pull_request:
5+
branches: [ master, develop ]
6+
7+
push:
8+
branches:
9+
- develop
10+
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [10.x, 12.x, 14.x]
19+
docker-tag: [latest, release, 4.7.1]
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: npm install and build
29+
run: npm ci
30+
31+
- name: Pull docker image
32+
run: docker pull existdb/existdb:${{ matrix.docker-tag }}
33+
34+
- name: Build docker image
35+
run: docker create --name exist-ci -p 8080:8080 -p 8443:8443 existdb/existdb:${{ matrix.docker-tag }}
36+
37+
- name: Start docker image
38+
run: docker start exist-ci
39+
40+
- name: Wait for existdb startup
41+
run: sleep 30
42+
43+
- name: npm test
44+
run: npm test

.releaserc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/npm",
6+
"@semantic-release/github",
7+
]
8+
}

0 commit comments

Comments
 (0)