forked from skyra-project/skyra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added gRPC into Node.js (skyra-project#1612)
* feat: added gRPC into Node.js - chore: fixed so the code compiles - refactor: move to workspace structure - refactor: move dist to typescript - fix: nullability warnings in Guild.cs - fix: change arrays that default to null! to Array<string>.Empty() * chore: bump c# deps closes skyra-project#1763 closes skyra-project#1761 Co-authored-by: Jeroen Claassens <[email protected]>
- Loading branch information
Showing
1,716 changed files
with
3,100 additions
and
5,947 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
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 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 |
---|---|---|
|
@@ -70,11 +70,11 @@ jobs: | |
path: node_modules | ||
key: ${{ runner.os }}-15-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install Dependencies | ||
run: yarn --ignore-scripts --frozen-lockfile | ||
run: yarn --frozen-lockfile | ||
- name: Run tsc | ||
run: yarn build | ||
|
||
NodeTesting: | ||
NodeUnitTesting: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
if: "!contains(needs.pre_ci.outputs.commit_message, '[skip ci]')" | ||
|
@@ -97,24 +97,81 @@ jobs: | |
yarn global add node-gyp node-pre-gyp | ||
- name: Install Dependencies | ||
run: yarn --frozen-lockfile | ||
- name: Run tests | ||
run: yarn test --coverage | ||
- name: Run gRPC generator script | ||
run: yarn scripts:grpc | ||
- name: Run unit tests | ||
run: yarn test:unit --coverage | ||
- name: Store code coverage report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: nodejs-coverage | ||
path: coverage/ | ||
|
||
NodeIntegrationTesting: | ||
name: Integration Tests | ||
runs-on: ubuntu-latest | ||
if: "!contains(needs.pre_ci.outputs.commit_message, '[skip ci]')" | ||
needs: pre_ci | ||
services: | ||
postgres: | ||
image: ghcr.io/skyra-project/postgres:latest | ||
env: | ||
POSTGRES_DB: skyra-nodejs-test | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
grpc: | ||
image: ghcr.io/skyra-project/grpc:latest | ||
env: | ||
POSTGRES_DB: skyra-nodejs-test | ||
POSTGRES_HOST: postgres | ||
ports: | ||
- '8291:80' | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@v2 | ||
- name: Use Node.js v15 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 15 | ||
- name: Restore CI Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-15-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install Dependencies | ||
run: yarn --frozen-lockfile | ||
- name: Run gRPC generator script | ||
run: yarn scripts:grpc | ||
- name: Wait for Skyra.Grpc | ||
run: | | ||
while ! nc -z localhost 8291; do | ||
sleep 0.1 # wait for 1/10 of the second before check again | ||
done | ||
- name: Run EntityFramework migrations | ||
run: | | ||
dotnet new tool-manifest | ||
dotnet tool install dotnet-ef | ||
dotnet tool run dotnet-ef database update -p Skyra.Database | ||
working-directory: services | ||
env: | ||
POSTGRES_DB: skyra-nodejs-test | ||
- name: Run Integration Tests | ||
run: yarn test:it | ||
|
||
DotNetCI: | ||
name: Dotnet Build & Test | ||
runs-on: ubuntu-latest | ||
if: "!contains(needs.pre_ci.outputs.commit_message, '[skip ci]')" | ||
needs: pre_ci | ||
services: | ||
postgres: | ||
image: postgres:12 | ||
image: ghcr.io/skyra-project/postgres:latest | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: skyra-dotnet-test | ||
options: >- | ||
--health-cmd pg_isready | ||
|
@@ -145,7 +202,7 @@ jobs: | |
dotnet tool install dotnet-ef | ||
dotnet tool run dotnet-ef database update --project services/Skyra.Database | ||
dotnet run --project services/Skyra.Grpc & | ||
while ! nc -z localhost 5000; do | ||
while ! nc -z localhost 8291; do | ||
sleep 0.1 # wait for 1/10 of the second before check again | ||
done | ||
dotnet test services/Skyra.IntegrationTests --collect:"XPlat Code Coverage" --settings services/coverlet.runsettings | ||
|
@@ -166,7 +223,7 @@ jobs: | |
name: Upload coverage report to codecov | ||
needs: | ||
- DotNetCI | ||
- NodeTesting | ||
- NodeUnitTesting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ node_modules/ | |
*.iml | ||
/rethinkdb_data/ | ||
coverage/ | ||
generated/ | ||
|
||
# Environment variables | ||
.DS_Store | ||
|
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 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 +1,2 @@ | ||
src/languages/**/*.json | ||
**/languages/**/*.json | ||
dist/ |
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,2 @@ | ||
--add.ignore-workspace-root-check true | ||
--remove.ignore-workspace-root-check true |
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 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 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
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,2 +1,2 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
module.exports = require('./dist/lib/database/database.config').config; | ||
module.exports = require('./typescript/dist/lib/database/database.config').config; |
Oops, something went wrong.