Skip to content

Commit

Permalink
Merge pull request #1 from step-security/release
Browse files Browse the repository at this point in the history
chore: initial release
  • Loading branch information
shubham-stepsecurity authored Nov 26, 2024
2 parents d1ffdca + 7655f00 commit bd95655
Show file tree
Hide file tree
Showing 19 changed files with 897 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"env": {
"node": true
},
"extends": [
"@supercharge"
],
"parserOptions": {
"ecmaVersion": 2018
}
}
21 changes: 21 additions & 0 deletions .github/workflows/actions_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release GitHub Actions

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the release"
required: true

permissions:
contents: read

jobs:
release:
permissions:
actions: read
id-token: write
contents: write
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
with:
tag: "${{ github.event.inputs.tag }}"
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Start MongoDB Server

on: [push, pull_request]

jobs:
mongodb-action:
name: Start MongoDB Server v${{ matrix.mongodb-version }}

runs-on: ubuntu-latest
strategy:
matrix:
mongodb-version: ['4.0', '4.2', '4.4', '5.0', '6.0']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start MongoDB Server
uses: ./
with:
mongodb-version: ${{ matrix.mongodb-version }}
44 changes: 44 additions & 0 deletions .github/workflows/test-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Single Instance With Auth

on: [push, pull_request]

jobs:
single-instance-with-auth:
name: Mongo v${{ matrix.mongodb-version }} - Node v${{ matrix.node-version }}

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
mongodb-version: ['4.4', '5.0', '6.0']
mongodb-db: ['ci']
mongodb-username: ['ci']
mongodb-password: ['ci']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-db: ${{ matrix.mongodb-db }}
mongodb-username: ${{ matrix.mongodb-username }}
mongodb-password: ${{ matrix.mongodb-password }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test ./test/single-instance
env:
CI: true
MONGODB_DB: ${{ matrix.mongodb-db }}
MONGODB_USERNAME: ${{ matrix.mongodb-username }}
MONGODB_PASSWORD: ${{ matrix.mongodb-password }}
72 changes: 72 additions & 0 deletions .github/workflows/test-replica-set.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Replica Set Tests

on: [push, pull_request]

jobs:
single-node-replica-set-on-default-port:
name: MongoDB v${{ matrix.mongodb-version }} RS — Node.js v${{ matrix.node-version }}

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
mongodb-version: ['4.4', '5.0', '6.0']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: mongodb-test-rs

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test ./test/replica-set
env:
CI: true
MONGODB_REPLICA_SET: mongodb-test-rs

single-node-replica-set-on-custom-port:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
mongodb-port: [23456]
mongodb-version: ['4.4', '5.0', '6.0']

name: MongoDB v${{ matrix.mongodb-version }} RS, Port ${{ matrix.mongodb-port }} — Node.js v${{ matrix.node-version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-port: ${{ matrix.mongodb-port }}
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: mongodb-test-rs

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test ./test/replica-set
env:
CI: true
MONGODB_PORT: ${{ matrix.mongodb-port }}
MONGODB_REPLICA_SET: mongodb-test-rs
69 changes: 69 additions & 0 deletions .github/workflows/test-single-instance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Single Instance Tests

on: [push, pull_request]

jobs:
single-instance-on-default-port:
name: MongoDB v${{ matrix.mongodb-version }} — Node.js v${{ matrix.node-version }}

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
mongodb-version: ['4.4', '5.0', '6.0']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test ./test/single-instance
env:
CI: true
MONGODB_DB: ${{ matrix.mongodb-db }}


single-instance-on-custom-port:
runs-on: ubuntu-latest
strategy:
matrix:
mongodb-port: [12345]
mongodb-version: ['4.4', '5.0', '6.0']
node-version: [18, 20]

name: MongoDB v${{ matrix.mongodb-version }}, Port ${{ matrix.mongodb-port }} — Node.js v${{ matrix.node-version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-port: ${{ matrix.mongodb-port }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test ./test/custom-port
env:
CI: true
14 changes: 14 additions & 0 deletions .github/workflows/validate-action-typings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate action typings

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
validate-typings:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: krzema12/github-actions-typing@v1
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
haters

lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
.github-todos

pids
results

node_modules
npm-debug.log
package-lock.json

# code coverage folder
coverage
.nyc_output

# Secrets
.env
.env.**

# IDEs and editors
.idea
.vscode

.vagrant
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM docker:stable
COPY start-mongodb.sh /start-mongodb.sh
RUN chmod +x /start-mongodb.sh
ENTRYPOINT ["/start-mongodb.sh"]
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2023 StepSecurity
Copyright (c) 2019 The Supercharge Node.js Framework

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit bd95655

Please sign in to comment.