-
Notifications
You must be signed in to change notification settings - Fork 4
Windows OS compatibility for CDS extractor and CAP models #297
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
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8a22232
Improve CDS extractor support for Windows OS
data-douser de18b40
Upgrade CDS Node.js dependencies to latest versions
data-douser b1fa87f
Add push/pull_request triggers to codeql-test-run-windows.yml
data-douser c7ab45d
Improve CDS extractor support for Windows OS
data-douser 467d7c2
Upgrade CDS Node.js dependencies to latest versions
data-douser 86efeec
Add push/pull_request triggers to codeql-test-run-windows.yml
data-douser e8cbe1e
Merge branch 'data-douser/cds-extractor-windows-os-3' of github.com:a…
data-douser c323e89
Rename unit testing workflows for Linux & Windows
data-douser 4ed14b1
Use strict test discovery in Windows workflow
data-douser a8ee2c2
Init .gitattributes
data-douser 8ac497a
Renormalize after .gitattributes update
data-douser ec2b702
Merge branch 'main' into data-douser/cds-extractor-windows-os-3
data-douser 865e2e8
Merge branch 'main' into data-douser/cds-extractor-windows-os-3
data-douser 52b7eed
Merge branch 'main' into data-douser/cds-extractor-windows-os-3
data-douser 644ac55
Merge branch 'main' into data-douser/cds-extractor-windows-os-3
data-douser 11d6035
Windows OS compatibility test 1
data-douser c62ef9e
Improve debug of ql-unit-tests-windows.yml workflow
data-douser 7f7d44d
Fix Windows cds compile for loop
data-douser 337de12
fix: normalize CDS $location.file paths for Windows
data-douser e2d0cae
Fix CDS extractor package dist sync
data-douser bd5443c
Refactor CDS compilation within actions workflows
data-douser 0d56b6a
Upgrade NodeJS deps for CDS extractor
data-douser 2c0f858
Apply suggestion from @Copilot
data-douser 5db6dd2
Merge branch 'main' into dd/cds-extractor-windows-debug/1
data-douser bb4d45c
Apply suggestion from @data-douser
data-douser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 @@ | ||
| * text=auto eol=lf | ||
| *.cmd text eol=crlf | ||
| *.bat text eol=crlf | ||
313 changes: 156 additions & 157 deletions
313
...lows/run-codeql-unit-tests-javascript.yml → .github/workflows/ql-unit-tests-linux.yml
This file contains hidden or 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,157 +1,156 @@ | ||
| name: ⚙️ CodeQL - Run Unit Tests (javascript) | ||
|
|
||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| pull_request: | ||
| branches: | ||
| - 'main' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| create-unit-test-matrix: | ||
| name: Create CodeQL Unit Test Matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.export-unit-test-matrix.outputs.matrix }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
|
|
||
| - name: Export unit test matrix | ||
| id: export-unit-test-matrix | ||
| run: | | ||
| qlt test run get-matrix --os-version ubuntu-latest | ||
|
|
||
| run-test-suites: | ||
| name: Run Unit Tests | ||
| needs: create-unit-test-matrix | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.create-unit-test-matrix.outputs.matrix) }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
|
|
||
| - name: Install CodeQL | ||
| id: install-codeql | ||
| shell: bash | ||
| run: | | ||
| echo "Installing CodeQL" | ||
| qlt codeql run install | ||
| echo "-----------------------------" | ||
| echo "CodeQL Home: $QLT_CODEQL_HOME" | ||
| echo "CodeQL Binary: $QLT_CODEQL_PATH" | ||
|
|
||
| - name: Verify Versions of Tooling | ||
| shell: bash | ||
| run: | | ||
| echo -e "Checking CodeQL Version:" | ||
| $QLT_CODEQL_PATH --version | ||
|
|
||
| echo -e "Checking QLT Version:" | ||
| echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | ||
| qlt version | ||
|
|
||
| - name: Install QL Packs | ||
| shell: bash | ||
| run: | | ||
| qlt query run install-packs | ||
|
|
||
| - name: Setup Node.js for CDS compilation | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: 'extractors/cds/tools/package-lock.json' | ||
|
|
||
| - name: Verify Node.js and npm tools | ||
| run: | | ||
| echo "Node.js version: $(node --version)" | ||
| echo "npm version: $(npm --version)" | ||
| echo "npx version: $(npx --version)" | ||
| # Verify npx can access @sap/cds-dk without installing globally | ||
| echo "Testing npx access to @sap/cds-dk..." | ||
| npx --yes --package @sap/cds-dk@latest cds --version || echo "CDS will be installed per-project as needed" | ||
|
|
||
| # Compile .cds files to .cds.json files using the dedicated test script | ||
| - name: Compile CAP CDS files | ||
| run: | | ||
| # Use the dedicated CDS compilation script that includes proper version resolution | ||
| # This script follows the same logic as the CDS extractor's resolveCdsVersions function | ||
| ./extractors/cds/tools/workflow/cds-compilation-for-actions.sh | ||
|
|
||
| - name: Run test suites | ||
| id: run-test-suites | ||
| env: | ||
| RUNNER_OS: ${{ runner.os }} | ||
| CODEQL_CLI: ${{ matrix.codeql_cli }} | ||
| CODEQL_STDLIB: ${{ matrix.codeql_standard_library }} | ||
| CODEQL_STDLIB_IDENT: ${{matrix.codeql_standard_library_ident}} | ||
| RUNNER_TMP: ${{ runner.temp }} | ||
| LGTM_INDEX_XML_MODE: all | ||
| LGTM_INDEX_FILETYPES: ".json:JSON\n.cds:JSON" | ||
|
|
||
| shell: bash | ||
| run: > | ||
| qlt test run execute-unit-tests | ||
| --codeql-args "--threads=0 --strict-test-discovery" | ||
| --num-threads 2 | ||
| --language javascript | ||
| --runner-os $RUNNER_OS | ||
| --work-dir $RUNNER_TMP | ||
|
|
||
| - name: Upload test results | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: test-results-${{ runner.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }} | ||
| path: | | ||
| ${{ runner.temp }}/test_report_${{ runner.os }}_${{ matrix.codeql_cli }}_${{ matrix.codeql_standard_library_ident }}_slice_*.json | ||
| if-no-files-found: error | ||
|
|
||
| validate-test-results: | ||
| name: Validate test results | ||
| needs: [run-test-suites] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
|
|
||
|
|
||
| - name: Collect test results | ||
| uses: actions/download-artifact@v7 | ||
|
|
||
| - name: Validate test results | ||
| run: | | ||
| qlt test run validate-unit-tests --pretty-print --results-directory . >> $GITHUB_STEP_SUMMARY | ||
| qlt test run validate-unit-tests --results-directory . | ||
| name: QL Unit Tests (Linux) | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| pull_request: | ||
| branches: | ||
| - 'main' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| create-unit-test-matrix: | ||
| name: Create CodeQL Unit Test Matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.export-unit-test-matrix.outputs.matrix }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
|
|
||
| - name: Export unit test matrix | ||
| id: export-unit-test-matrix | ||
| run: | | ||
| qlt test run get-matrix --os-version ubuntu-latest | ||
|
|
||
| run-test-suites: | ||
| name: Run Unit Tests | ||
| needs: create-unit-test-matrix | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.create-unit-test-matrix.outputs.matrix) }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
|
|
||
| - name: Install CodeQL | ||
| id: install-codeql | ||
| shell: bash | ||
| run: | | ||
| echo "Installing CodeQL" | ||
| qlt codeql run install | ||
| echo "-----------------------------" | ||
| echo "CodeQL Home: $QLT_CODEQL_HOME" | ||
| echo "CodeQL Binary: $QLT_CODEQL_PATH" | ||
|
|
||
| - name: Verify Versions of Tooling | ||
| shell: bash | ||
| run: | | ||
| echo -e "Checking CodeQL Version:" | ||
| $QLT_CODEQL_PATH --version | ||
|
|
||
| echo -e "Checking QLT Version:" | ||
| echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | ||
| qlt version | ||
|
|
||
| - name: Install QL Packs | ||
| shell: bash | ||
| run: | | ||
| qlt query run install-packs | ||
|
|
||
| - name: Setup Node.js for CDS compilation | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: 'extractors/cds/tools/package-lock.json' | ||
|
|
||
| - name: Verify Node.js and npm tools | ||
| run: | | ||
| echo "Node.js version: $(node --version)" | ||
| echo "npm version: $(npm --version)" | ||
| echo "npx version: $(npx --version)" | ||
| # Verify npx can access @sap/cds-dk without installing globally | ||
| echo "Testing npx access to @sap/cds-dk..." | ||
| npx --yes --package @sap/cds-dk@latest cds --version || echo "CDS will be installed per-project as needed" | ||
|
|
||
| # Compile .cds files to .cds.json files using the dedicated test script | ||
| - name: Compile CAP CDS files | ||
| run: | | ||
| # Use the dedicated CDS compilation script that includes proper version resolution | ||
| # This script follows the same logic as the CDS extractor's resolveCdsVersions function | ||
| ./extractors/cds/tools/workflow/cds-compilation-for-actions.sh | ||
|
|
||
| - name: Run test suites | ||
| id: run-test-suites | ||
| env: | ||
| RUNNER_OS: ${{ runner.os }} | ||
| CODEQL_CLI: ${{ matrix.codeql_cli }} | ||
| CODEQL_STDLIB: ${{ matrix.codeql_standard_library }} | ||
| CODEQL_STDLIB_IDENT: ${{matrix.codeql_standard_library_ident}} | ||
| RUNNER_TMP: ${{ runner.temp }} | ||
| LGTM_INDEX_XML_MODE: all | ||
| LGTM_INDEX_FILETYPES: ".json:JSON\n.cds:JSON" | ||
|
|
||
| shell: bash | ||
| run: > | ||
| qlt test run execute-unit-tests | ||
| --codeql-args "--threads=0 --strict-test-discovery" | ||
| --num-threads 2 | ||
| --language javascript | ||
| --runner-os $RUNNER_OS | ||
| --work-dir $RUNNER_TMP | ||
|
|
||
| - name: Upload test results | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: test-results-${{ runner.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }} | ||
| path: | | ||
| ${{ runner.temp }}/test_report_${{ runner.os }}_${{ matrix.codeql_cli }}_${{ matrix.codeql_standard_library_ident }}_slice_*.json | ||
| if-no-files-found: error | ||
|
|
||
| validate-test-results: | ||
| name: Validate test results | ||
| needs: [run-test-suites] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
|
|
||
|
|
||
| - name: Collect test results | ||
| uses: actions/download-artifact@v7 | ||
|
|
||
| - name: Validate test results | ||
| run: | | ||
| qlt test run validate-unit-tests --pretty-print --results-directory . >> $GITHUB_STEP_SUMMARY | ||
| qlt test run validate-unit-tests --results-directory . |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.