-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (127 loc) · 3.68 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: test & release
# Run the workflow when a Pull Request is opened or when changes are pushed to master
on:
pull_request:
push:
branches:
- master
- feature/githubaction
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Run the steps below with the following versions of Node.js
node-version: [12.x, 14.x, 16.x, 18.x]
services:
neo4j:
image: neo4j
ports:
- 7474:7474
- 7687:7687
env:
NEO4J_AUTH: neo4j/new
NEO4J_dbms_connector_http_advertised__address: "neo4j:7474"
NEO4J_dbms_connector_bolt_advertised__address: "neo4j:7687"
NEO4J_dbms_security_auth__minimum__password__length: 3
steps:
# Fetch the latest commit
- name: Checkout
uses: actions/checkout@v2
# Setup Node.js using the appropriate version
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
# Install package dependencies
- name: Install
run: npm i -f
# Run tests
- name: Test
run: npm run test-ci
env:
NEO_URI: neo4j://localhost:7687
NEO_USER: neo4j
NEO_PASS: new
release-dry:
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
needs: [test]
services:
neo4j:
image: neo4j
ports:
- 7474:7474
- 7687:7687
env:
NEO4J_AUTH: neo4j/new
NEO4J_dbms_connector_http_advertised__address: "neo4j:7474"
NEO4J_dbms_connector_bolt_advertised__address: "neo4j:7687"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
- name: Install
run: npm i -f
- name: Release (dry)
run: npm run semantic-release-dry
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
NEO_URI: neo4j://localhost:7687
NEO_USER: neo4j
NEO_PASS: new
# -------------------------------------------------------------
# Release
# -------------------------------------------------------------
release:
# Only release on push to master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
# Waits for test jobs for each Node.js version to complete
needs: [test]
services:
neo4j:
image: neo4j
ports:
- 7474:7474
- 7687:7687
env:
NEO4J_AUTH: neo4j/new
NEO4J_dbms_connector_http_advertised__address: "neo4j:7474"
NEO4J_dbms_connector_bolt_advertised__address: "neo4j:7687"
NEO4J_dbms_security_auth__minimum__password__length: 3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
- name: Install
run: npm i -f
- name: Release
run: npm run semantic-release && npm run coveralls
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
NEO_URI: neo4j://localhost:7687
NEO_USER: neo4j
NEO_PASS: new