Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

01 #5

Merged
merged 2 commits into from
Oct 1, 2023
Merged

01 #5

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Node CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install

- name: Run linting
run: |
npm run lint

- name: Build
run: |
npm run build --if-present

- name: Run tests and generate coverage
run: |
npm run test

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/sonarpush.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Sonar push
on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "18.12.1"
- name: Install dependencies
run: npm install
- name: Install Jest globally
run: sudo npm install -g jest
- name: Run Tests
env:
SECRET: mockSecret
run: npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

test-report.xml
14 changes: 14 additions & 0 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

const common = [
'--require-module ts-node/register' // Load TypeScript module
];

const apiApp_backend = [
...common,
'tests/apps/apiApp/backend/features/**/*.feature',
'--require tests/apps/apiApp/backend/features/step_definitions/*.steps.ts'
].join(' ');

module.exports = {
apiApp_backend
};
13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
cacheDirectory: '.tmp/jestCache',
collectCoverage: true,
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
watchPathIgnorePatterns: ["<rootDir>/test-report.json"],
reporters: ["default"],
testResultsProcessor: "jest-sonar-reporter",
coverageReporters: ["text", "html", "lcov", "clover"],
coveragePathIgnorePatterns: ["/node_modules/", "/test/"]
};
Loading
Loading