From 746719e7fae7f372ef981b356e72aab1c3add6e8 Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 00:44:28 +0300 Subject: [PATCH 1/7] generate build yml --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f180f5b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: CI Workflow + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build + - run: npm test + - run: npm run test:coverage + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # - name: Run Snyk to check for vulnerabilities + # uses: snyk/actions/node@master + # env: + # SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} From 57c52256d6b2c86308217267a41e0766adea7d2c Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 00:47:20 +0300 Subject: [PATCH 2/7] ignore dist in jest --- jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.js b/jest.config.js index b35ba67..bd17bbb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,6 +5,7 @@ module.exports = { '^.+\\.ts?$': 'ts-jest', }, transformIgnorePatterns: ['/node_modules/'], + modulePathIgnorePatterns: ['/dist/'], forceExit: true, detectOpenHandles: true, cache: false From 8d370538b99ee38284dcd4085aa3bfb813d9a401 Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 00:51:16 +0300 Subject: [PATCH 3/7] add sonar project info --- sonar-project.properties | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..fb321b3 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=muhtalipdede_avrasya +sonar.organization=avrasya From 7cf3af51ed0a85f3ec4f3138b637a47359587b46 Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 00:57:19 +0300 Subject: [PATCH 4/7] update --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 9e3d847..3eb1b80 100644 --- a/Readme.md +++ b/Readme.md @@ -214,4 +214,4 @@ This project is licensed under the MIT License. For more information, please ref [npm-install-size-image]: https://badgen.net/packagephobia/install/avrasya [npm-install-size-url]: https://packagephobia.com/result?p=avrasya [npm-url]: https://npmjs.org/package/avrasya -[npm-version-image]: https://badgen.net/npm/v/avrasya \ No newline at end of file +[npm-version-image]: https://badgen.net/npm/v/avrasya From 72b168f832b13cc795b25a0c7ba718a57082414e Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 01:03:24 +0300 Subject: [PATCH 5/7] define sonar coverage path --- sonar-project.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/sonar-project.properties b/sonar-project.properties index fb321b3..a488019 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,3 @@ sonar.projectKey=muhtalipdede_avrasya sonar.organization=avrasya +sonar.javascript.lcov.reportPaths=./coverage/lcov.info From faa340343c0c19b71be7019082b2d0e561b6fb4e Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 01:06:31 +0300 Subject: [PATCH 6/7] update report path --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index a488019..ef3de49 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,3 @@ sonar.projectKey=muhtalipdede_avrasya sonar.organization=avrasya -sonar.javascript.lcov.reportPaths=./coverage/lcov.info +sonar.javascript.lcov.reportPaths=coverage/lcov.info From d9f201f6e297578f47b1a233a660edf4b415640d Mon Sep 17 00:00:00 2001 From: Harun Sokullu Date: Thu, 2 Nov 2023 01:09:38 +0300 Subject: [PATCH 7/7] update report path --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index ef3de49..b8b89f2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,3 @@ sonar.projectKey=muhtalipdede_avrasya sonar.organization=avrasya -sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.javascript.lcov.reportPaths=/coverage/lcov.info