From 3b7b9445ef44faf2d3c32df76efde17ed0009012 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sat, 5 Feb 2022 00:46:57 +0200 Subject: [PATCH 1/7] Composing a separate build string for sonar analysis on parallel builds --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8703e24d9..5d6c5391f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,6 +135,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.buildString=${{ format( '{0}.{1}', env.UTPLSQL_BUILD_VERSION, matrix.id ) }} publish: name: Deploy documentation From f216a282c98158496261bc8c61a6a25d7852d0ab Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sat, 5 Feb 2022 01:23:07 +0200 Subject: [PATCH 2/7] Adding data-dictionary analysis --- .github/workflows/build.yml | 2 ++ sonar-project.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d6c5391f..0d5d3267d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,6 +138,8 @@ jobs: with: args: > -Dsonar.buildString=${{ format( '{0}.{1}', env.UTPLSQL_BUILD_VERSION, matrix.id ) }} + -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@{0}', env.CONNECTION_STR ) }} + -Dsonar.plsql.jdbc.driver.path=${{ format( '{0}/ojdbc8.jar', env.OJDBC_HOME ) }} publish: name: Deploy documentation diff --git a/sonar-project.properties b/sonar-project.properties index b68d13879..7559b58a1 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -29,9 +29,9 @@ sonar.pullrequest.github.endpoint=https://api.github.com/ sonar.pullrequest.github.repository=utPLSQL/utPLSQL sonar.plsql.jdbc.driver.class=oracle.jdbc.OracleDriver -sonar.plsql.jdbc.user=UT3 +sonar.plsql.jdbc.user=UT3_DEVELOP sonar.plsql.jdbc.password=ut3 -sonar.plsql.defaultSchema=UT3 +sonar.plsql.defaultSchema=UT3_DEVELOP # Encoding of the source code. Default is default system encoding From 3f4d2f601088e399c4f25ae57f72a070851b5233 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 6 Feb 2022 00:47:51 +0200 Subject: [PATCH 3/7] Adding Codecov. Trying to fix Sonar DB level analysis. --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d5d3267d..209cb0fe1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,6 +129,15 @@ jobs: id: validate-reports-format run: bash .github/scripts/validate_report_files.sh + - name: Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./cobertura.xml + flags: ${{matrix.db_version_name}} + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) + - name: SonarCloud Scan id: sonar uses: SonarSource/sonarcloud-github-action@master @@ -138,7 +147,7 @@ jobs: with: args: > -Dsonar.buildString=${{ format( '{0}.{1}', env.UTPLSQL_BUILD_VERSION, matrix.id ) }} - -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@{0}', env.CONNECTION_STR ) }} + -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//{0}', env.CONNECTION_STR ) }} -Dsonar.plsql.jdbc.driver.path=${{ format( '{0}/ojdbc8.jar', env.OJDBC_HOME ) }} publish: From 0e5d40401b0e57a4450d94a402dfb5067fa7a755 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 6 Feb 2022 01:18:53 +0200 Subject: [PATCH 4/7] Trying to fix Sonar DB level analysis. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 209cb0fe1..a0ed47f21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,7 +147,7 @@ jobs: with: args: > -Dsonar.buildString=${{ format( '{0}.{1}', env.UTPLSQL_BUILD_VERSION, matrix.id ) }} - -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//{0}', env.CONNECTION_STR ) }} + -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//oracle:1521/XE', env.CONNECTION_STR ) }} -Dsonar.plsql.jdbc.driver.path=${{ format( '{0}/ojdbc8.jar', env.OJDBC_HOME ) }} publish: From 6bcf8a4e711af5369bc001178b257060d94bf633 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 6 Feb 2022 01:57:45 +0200 Subject: [PATCH 5/7] Parametrizing Sonar Oracle DB SID --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0ed47f21..dcf70799f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: runs-on: ubuntu-latest env: ORACLE_VERSION: ${{matrix.oracle-version}} + ORACLE_SID: ${{matrix.oracle-sid}} CONNECTION_STR: ${{matrix.connection-str}} ORACLE_PASSWORD: oracle DOCKER_VOLUME: ${{matrix.docker-volume}} @@ -27,31 +28,38 @@ jobs: matrix: include: - oracle-version: "gvenzl/oracle-xe:11-full" + oracle-sid: 'XE' connection-str: '127.0.0.1:1521/XE' id: 1 db_version_name: '11xe' # TODO - need to add healthcheck.sh into our containers # - oracle-version: "utplsqlv3/oracledb:12c-r1-se2-small" +# oracle-sid: 'ORCLCDB' # connection-str: '127.0.0.1:1521/ORCLCDB' # id: 2 # db_version_name: '12.1se' # - oracle-version: "utplsqlv3/oracledb:12c-r2-se2-small" +# oracle-sid: 'ORCLCDB' # connection-str: '127.0.0.1:1521/ORCLCDB' # id: 3 # db_version_name: '12.2se' - oracle-version: "gvenzl/oracle-xe:18-slim" + oracle-sid: 'XE' connection-str: '127.0.0.1:1521/XE' id: 4 db_version_name: '18xe' # - oracle-version: "utplsqlv3/oracledb:18c-se2-small" +# oracle-sid: 'ORCLCDB' # connection-str: '127.0.0.1:1521/ORCLCDB' # id: 5 # db_version_name: '18se' # - oracle-version: "utplsqlv3/oracledb:19c-se2-small" +# oracle-sid: 'ORCLCDB' # connection-str: '127.0.0.1:1521/ORCLCDB' # id: 6 # db_version_name: '19se' - oracle-version: "gvenzl/oracle-xe:21-slim" + oracle-sid: 'XE' connection-str: '127.0.0.1:1521/XE' id: 7 db_version_name: '21xe' @@ -147,7 +155,7 @@ jobs: with: args: > -Dsonar.buildString=${{ format( '{0}.{1}', env.UTPLSQL_BUILD_VERSION, matrix.id ) }} - -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//oracle:1521/XE', env.CONNECTION_STR ) }} + -Dsonar.plsql.jdbc.url=${{ format( 'jdbc:oracle:thin:@//oracle:1521/{0}', env.ORACLE_SID ) }} -Dsonar.plsql.jdbc.driver.path=${{ format( '{0}/ojdbc8.jar', env.OJDBC_HOME ) }} publish: From afa7bce4b73e0b1d8223d84d73e13680c5aecea0 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 6 Feb 2022 02:25:54 +0200 Subject: [PATCH 6/7] Adding test results publishing --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcf70799f..4ad7a176d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,6 +146,12 @@ jobs: fail_ci_if_error: true # optional (default = false) verbose: true # optional (default = false) + - name: Publish unit test results + uses: EnricoMi/publish-unit-test-result-action@v1.24 + if: always() + with: + files: junit_test_results.xml + - name: SonarCloud Scan id: sonar uses: SonarSource/sonarcloud-github-action@master From 1448ef1e6977ec5adeba67562480367b049e434a Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 6 Feb 2022 16:36:22 +0200 Subject: [PATCH 7/7] CodeCov changes --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ad7a176d..05fc26c3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,7 +144,6 @@ jobs: files: ./cobertura.xml flags: ${{matrix.db_version_name}} fail_ci_if_error: true # optional (default = false) - verbose: true # optional (default = false) - name: Publish unit test results uses: EnricoMi/publish-unit-test-result-action@v1.24