Skip to content

Commit

Permalink
chore(cb2-8502): bump lambda to node 18 (#76)
Browse files Browse the repository at this point in the history
* chore(cb2-8502): update to node 18

* chore(cb2-8502): change nop commit

* chore(cb2-8502): align sonar properties file with other repos

* chore(cb2-8502): add submodule

* chore(cb2-8502): add models back in ignore

* bump cvs-nop to develop

* chore(cb2-8502): add github actions

* chore(cb2-8502): bump packages

* chore(cb2-8502): remove libs check

* chore: bump version in serverless
  • Loading branch information
gjulien-bjss authored Aug 9, 2023
1 parent 622c7bd commit 88d3f69
Show file tree
Hide file tree
Showing 72 changed files with 25,117 additions and 20,595 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: CI

on:
push:

jobs:
security:
uses: dvsa/.github/.github/workflows/nodejs-security.yaml@v2
with:
args: '--all-projects'
secrets:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: PR-checks

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]

jobs:
build-test:
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci

- name: Unit tests
run: npm run test

- name: Build
run: npm run build
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.*
18.*
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
module.exports = { extends: ["@commitlint/config-conventional"] };
50 changes: 26 additions & 24 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
const gulp = require('gulp');
const exec = require('child_process').exec;
const process = require('process');
const gulp = require("gulp");
const exec = require("child_process").exec;
const process = require("process");

gulp.task('start-serverless', function (done) {
const instance = exec('node_modules/serverless/bin/serverless offline start &');
gulp.task("start-serverless", function (done) {
const instance = exec(
"node_modules/serverless/bin/serverless offline start &"
);

instance.stdout.on('data', function (output) {
process.stdout.write(output);
instance.stdout.on("data", function (output) {
process.stdout.write(output);

if (output.search('replay the last request') !== -1) {
done();
process.exit(0);
}
if (output.search("replay the last request") !== -1) {
done();
process.exit(0);
}

if (output.search('Error') !== -1) {
done();
process.exit(-1);
}
});
if (output.search("Error") !== -1) {
done();
process.exit(-1);
}
});

instance.on('close', function (code) {
console.info(`Process exited with code ${code}`);
done()
})
instance.on("close", function (code) {
console.info(`Process exited with code ${code}`);
done();
});
});

gulp.task('kill-serverless', function (done) {
exec('pkill -2 node');
exec('pkill -2 java');
gulp.task("kill-serverless", function (done) {
exec("pkill -2 node");
exec("pkill -2 java");

done()
done();
});
25 changes: 10 additions & 15 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
process.env.TZ = 'GMT';
process.env.TZ = "GMT";
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: [
'<rootDir>/src',
'<rootDir>/tests'
],
setupFiles: [
'jest-plugin-context/setup'
],
moduleFileExtensions: ['js', 'ts'],
testResultsProcessor: 'jest-sonar-reporter',
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/src", "<rootDir>/tests"],
setupFiles: ["jest-plugin-context/setup"],
moduleFileExtensions: ["js", "ts"],
testResultsProcessor: "jest-sonar-reporter",
transform: {
'^.+\\.tsx?$': 'ts-jest'
"^.+\\.tsx?$": "ts-jest",
},
testMatch: ['**/*.*Test.ts']
}
testMatch: ["**/*.*Test.ts"],
};
Loading

0 comments on commit 88d3f69

Please sign in to comment.