-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
168 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: sails-mongo lint | ||
|
||
on: | ||
push | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20] | ||
|
||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install --no-audit --no-fund | ||
- name: Lint the code | ||
run: | | ||
npm run lint-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: sails-mongo test (Ubuntu) | ||
|
||
on: | ||
push | ||
|
||
env: | ||
WATERLINE_ADAPTER_TESTS_URL: mongo/testdb:27027 | ||
WATERLINE_ADAPTER_TESTS_HOST: mongo | ||
WATERLINE_ADAPTER_TESTS_DATABASE: sails-mongo | ||
NODE_ENV: test | ||
|
||
jobs: | ||
test-ubuntu: | ||
runs-on: ubuntu-22.04 | ||
container: node:${{ matrix.node-version }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16, 18, 20] | ||
mongodb-version: ['4.4', '5', '6', '7'] | ||
|
||
services: | ||
mongo: | ||
image: mongo:${{ matrix.mongodb-version }} | ||
ports: | ||
- 27027:27017 | ||
|
||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
node --eval "console.log('Running Node.js: ' + process.version)" | ||
node --eval "console.log('Current directory: ' + process.cwd())" | ||
node --eval "console.log('Files in directory: ' + require('fs').readdirSync(process.cwd()))" | ||
npm install --no-audit --no-fund | ||
- name: Test it out | ||
run: | | ||
npm run custom-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: sails-mongo test (Windows) | ||
|
||
on: | ||
push | ||
|
||
env: | ||
WATERLINE_ADAPTER_TESTS_URL: 127.0.0.1/testdb | ||
WATERLINE_ADAPTER_TESTS_HOST: 127.0.0.1 | ||
WATERLINE_ADAPTER_TESTS_DATABASE: sails-mongo | ||
NODE_ENV: test | ||
|
||
jobs: | ||
test-windows: | ||
runs-on: windows-2022 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x, 20.x] | ||
mongodb-version: ['5.0'] | ||
|
||
steps: | ||
- uses: ankane/setup-mongodb@ce30d9041565cb469945895d5bde3384a254dd2e # use commit ID until action is versioned, see https://github.com/ankane/setup-mongodb/issues/2 | ||
with: | ||
mongodb-version: ${{ matrix.mongodb-version }} | ||
|
||
- name: Wait for MongoDB to start | ||
run: | | ||
while ($true) { | ||
$status = Get-Service MongoDB | Select-Object -ExpandProperty Status | ||
if ($status -eq "Running") { | ||
Write-Host "MongoDB is running." | ||
break | ||
} | ||
Write-Host "Waiting for MongoDB to start..." | ||
Start-Sleep -Seconds 5 | ||
} | ||
shell: pwsh | ||
|
||
- name: Install Mongodb Shell | ||
run: | | ||
choco install mongodb-shell -y | ||
shell: pwsh | ||
|
||
- name: Check connection to Mongodb using mongodb shell | ||
run: | | ||
mongosh --eval "db.adminCommand('listDatabases')" | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install --no-audit --no-fund | ||
- name: Test code | ||
run: | | ||
npm run custom-tests |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
adapter: | ||
image: node:12 | ||
volumes: | ||
- $PWD:/home/node/sails-mongo | ||
links: | ||
- mongo | ||
environment: | ||
- WATERLINE_ADAPTER_TESTS_DATABASE=sails-mongo | ||
- WATERLINE_ADAPTER_TESTS_URL=mongo/testdb | ||
- WATERLINE_ADAPTER_TESTS_HOST=mongo | ||
- NODE_ENV=test | ||
user: node | ||
working_dir: /home/node/sails-mongo | ||
command: | ||
- bash -c "npm test" | ||
version: "3.8" | ||
services: | ||
adapter: | ||
image: node:20 | ||
volumes: | ||
- $PWD:/home/node/sails-mongo | ||
links: | ||
- mongo | ||
environment: | ||
- WATERLINE_ADAPTER_TESTS_DATABASE=sails-mongo | ||
- WATERLINE_ADAPTER_TESTS_URL=mongo/testdb | ||
- WATERLINE_ADAPTER_TESTS_HOST=mongo | ||
- NODE_ENV=test | ||
user: node | ||
working_dir: /home/node/sails-mongo | ||
command: | ||
- bash -c "npm test" | ||
|
||
mongo: | ||
image: mongo:4.2 | ||
restart: always | ||
command: "--logpath=/dev/null" | ||
ports: | ||
- "27017:27017" | ||
mongo: | ||
image: mongo:7 | ||
restart: always | ||
command: "--logpath=/dev/null" | ||
ports: | ||
- "27017:27017" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.