Skip to content

Commit bd95655

Browse files
Merge pull request #1 from step-security/release
chore: initial release
2 parents d1ffdca + 7655f00 commit bd95655

19 files changed

+897
-1
lines changed

.eslintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"extends": [
6+
"@supercharge"
7+
],
8+
"parserOptions": {
9+
"ecmaVersion": 2018
10+
}
11+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release GitHub Actions
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the release"
8+
required: true
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release:
15+
permissions:
16+
actions: read
17+
id-token: write
18+
contents: write
19+
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
20+
with:
21+
tag: "${{ github.event.inputs.tag }}"

.github/workflows/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Start MongoDB Server
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
mongodb-action:
7+
name: Start MongoDB Server v${{ matrix.mongodb-version }}
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
mongodb-version: ['4.0', '4.2', '4.4', '5.0', '6.0']
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Start MongoDB Server
19+
uses: ./
20+
with:
21+
mongodb-version: ${{ matrix.mongodb-version }}

.github/workflows/test-auth.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Single Instance With Auth
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
single-instance-with-auth:
7+
name: Mongo v${{ matrix.mongodb-version }} - Node v${{ matrix.node-version }}
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [18, 20]
13+
mongodb-version: ['4.4', '5.0', '6.0']
14+
mongodb-db: ['ci']
15+
mongodb-username: ['ci']
16+
mongodb-password: ['ci']
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
23+
uses: ./
24+
with:
25+
mongodb-version: ${{ matrix.mongodb-version }}
26+
mongodb-db: ${{ matrix.mongodb-db }}
27+
mongodb-username: ${{ matrix.mongodb-username }}
28+
mongodb-password: ${{ matrix.mongodb-password }}
29+
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Run tests
39+
run: npm test ./test/single-instance
40+
env:
41+
CI: true
42+
MONGODB_DB: ${{ matrix.mongodb-db }}
43+
MONGODB_USERNAME: ${{ matrix.mongodb-username }}
44+
MONGODB_PASSWORD: ${{ matrix.mongodb-password }}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Replica Set Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
single-node-replica-set-on-default-port:
7+
name: MongoDB v${{ matrix.mongodb-version }} RS — Node.js v${{ matrix.node-version }}
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [18, 20]
13+
mongodb-version: ['4.4', '5.0', '6.0']
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
20+
uses: ./
21+
with:
22+
mongodb-version: ${{ matrix.mongodb-version }}
23+
mongodb-replica-set: mongodb-test-rs
24+
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
30+
- name: Install dependencies
31+
run: npm install
32+
33+
- name: Run tests
34+
run: npm test ./test/replica-set
35+
env:
36+
CI: true
37+
MONGODB_REPLICA_SET: mongodb-test-rs
38+
39+
single-node-replica-set-on-custom-port:
40+
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
node-version: [18, 20]
44+
mongodb-port: [23456]
45+
mongodb-version: ['4.4', '5.0', '6.0']
46+
47+
name: MongoDB v${{ matrix.mongodb-version }} RS, Port ${{ matrix.mongodb-port }} — Node.js v${{ matrix.node-version }}
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
53+
uses: ./
54+
with:
55+
mongodb-port: ${{ matrix.mongodb-port }}
56+
mongodb-version: ${{ matrix.mongodb-version }}
57+
mongodb-replica-set: mongodb-test-rs
58+
59+
- name: Use Node.js ${{ matrix.node-version }}
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: ${{ matrix.node-version }}
63+
64+
- name: Install dependencies
65+
run: npm install
66+
67+
- name: Run tests
68+
run: npm test ./test/replica-set
69+
env:
70+
CI: true
71+
MONGODB_PORT: ${{ matrix.mongodb-port }}
72+
MONGODB_REPLICA_SET: mongodb-test-rs
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Single Instance Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
single-instance-on-default-port:
7+
name: MongoDB v${{ matrix.mongodb-version }} — Node.js v${{ matrix.node-version }}
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [18, 20]
13+
mongodb-version: ['4.4', '5.0', '6.0']
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
20+
uses: ./
21+
with:
22+
mongodb-version: ${{ matrix.mongodb-version }}
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
- name: Run tests
33+
run: npm test ./test/single-instance
34+
env:
35+
CI: true
36+
MONGODB_DB: ${{ matrix.mongodb-db }}
37+
38+
39+
single-instance-on-custom-port:
40+
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
mongodb-port: [12345]
44+
mongodb-version: ['4.4', '5.0', '6.0']
45+
node-version: [18, 20]
46+
47+
name: MongoDB v${{ matrix.mongodb-version }}, Port ${{ matrix.mongodb-port }} — Node.js v${{ matrix.node-version }}
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
53+
uses: ./
54+
with:
55+
mongodb-version: ${{ matrix.mongodb-version }}
56+
mongodb-port: ${{ matrix.mongodb-port }}
57+
58+
- name: Use Node.js ${{ matrix.node-version }}
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: ${{ matrix.node-version }}
62+
63+
- name: Install dependencies
64+
run: npm install
65+
66+
- name: Run tests
67+
run: npm test ./test/custom-port
68+
env:
69+
CI: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Validate action typings
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
validate-typings:
11+
runs-on: "ubuntu-latest"
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: krzema12/github-actions-typing@v1

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
haters
2+
3+
lib-cov
4+
*.seed
5+
*.log
6+
*.csv
7+
*.dat
8+
*.out
9+
*.pid
10+
*.gz
11+
.github-todos
12+
13+
pids
14+
results
15+
16+
node_modules
17+
npm-debug.log
18+
package-lock.json
19+
20+
# code coverage folder
21+
coverage
22+
.nyc_output
23+
24+
# Secrets
25+
.env
26+
.env.**
27+
28+
# IDEs and editors
29+
.idea
30+
.vscode
31+
32+
.vagrant

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM docker:stable
2+
COPY start-mongodb.sh /start-mongodb.sh
3+
RUN chmod +x /start-mongodb.sh
4+
ENTRYPOINT ["/start-mongodb.sh"]

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 StepSecurity
4+
Copyright (c) 2019 The Supercharge Node.js Framework
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

0 commit comments

Comments
 (0)