-
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.
Windows version in testing
- Loading branch information
Showing
6 changed files
with
146 additions
and
161 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,142 @@ | ||
name: Node CI | ||
|
||
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: | ||
lint-and-test-ubuntu: | ||
runs-on: ubuntu-20.04 | ||
container: node:${{ matrix.node-version }} | ||
|
||
# Service containers to run with `container-job` | ||
services: | ||
# Label used to access the service container | ||
mongo: | ||
# Docker Hub image | ||
image: mongo:${{ matrix.mongodb-version }} | ||
# Set health checks to wait until redis has started | ||
options: >- | ||
--health-cmd "mongo --eval 'db.runCommand({ ping: 1 })'" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 27027:27017 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16, 18, 20] | ||
mongodb-version: ['4.4', '5.0'] | ||
|
||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Cache node modules | ||
# id: cache-npm | ||
# uses: actions/cache@v3 | ||
# env: | ||
# cache-name: cache-node-modules | ||
# with: | ||
# # npm cache files are stored in `~/.npm` on Linux/macOS | ||
# path: ~/.npm | ||
# key: build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-build-${{ env.cache-name }}- | ||
# ${{ runner.os }}-build- | ||
# ${{ runner.os }}- | ||
# | ||
# - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | ||
# name: List the state of node modules | ||
# continue-on-error: true | ||
# run: npm list | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install --no-audit --no-fund | ||
- name: Lint the code | ||
run: | | ||
npm run lint-test | ||
if: matrix.node-version == '16' | ||
|
||
- name: Test it out | ||
run: | | ||
npm run custom-tests | ||
# lint-and-test-windows: | ||
# runs-on: windows-2022 | ||
# | ||
# strategy: | ||
# matrix: | ||
# node-version: [16.x] # , 18.x, 20.x] | ||
# mongodb-version: [4.4] | ||
# | ||
# steps: | ||
# - name: Use MongoDB ${{ matrix.mongodb-version }} | ||
# run: | | ||
# # Get versions | ||
# $url = "https://raw.githubusercontent.com/mkevenaar/chocolatey-packages/master/automatic/mongodb.portable/mongodb.portable.json" | ||
# $response = Invoke-WebRequest -Uri $url | ||
# $content = $response.Content.TrimStart([Char]0xFEFF) # Remove BOM | ||
# $global:versions = $content | ConvertFrom-Json | ||
# $version = "${{ matrix.mongodb-version }}" | ||
# | ||
# $fullVersion = $global:versions.$version | ||
# $url = "https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-$fullVersion.zip" | ||
# $zipfile = "mongodb.zip" | ||
# Invoke-WebRequest -Uri $url -OutFile $zipfile | ||
# | ||
# $destination = "C:\mongodb" | ||
# $mongodbPath = "$destination\$version" | ||
# & Expand-Archive -LiteralPath $zipfile -DestinationPath $destination | ||
# & Move-Item -Path "$destination\mongodb-win32-x86_64-windows-$fullVersion" -Destination "$mongodbPath" | ||
# dir $destination | ||
# | ||
# $dataDir = Join-Path -Path $mongodbPath -ChildPath "\data\db" | ||
# New-Item -ItemType Directory -Force -Path $dataDir | ||
# $port = 27027 | ||
# & Start-Process -NoNewWindow "$mongodbPath\bin\mongod.exe" -ArgumentList '--quiet', '--dbpath', $dataDir, '--port', $port, '--nojournal', '--oplogSize', 1, '--bind_ip', '127.0.0.1' | ||
# | ||
# echo "Checking MongoDB $version instance..." | ||
# $connected = $false | ||
# $attempts = 0 | ||
# do { | ||
# & "$mongodbPath\bin\mongo.exe" --port "$port" --eval "db.runCommand({ ping: 1 })" | ||
# if ($LASTEXITCODE -eq 0) { | ||
# $connected = $true | ||
# } else { | ||
# Write-Output "Unable to connect, retrying..." | ||
# Start-Sleep -Seconds 1 | ||
# $attempts++ | ||
# } | ||
# } while (!$connected -and $attempts -lt 10) | ||
# | ||
# if (!$connected) { | ||
# Write-Output "Failed to connect to MongoDB $version instance after 10 attempts" | ||
# exit 1 | ||
# } | ||
# | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v3 | ||
# | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
# | ||
# - 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
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