Merge pull request #129 from SAP-samples/Feb2026 #10
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
| name: Cross-Platform Tests | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node-version: [20.x, 22.x, 24.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint --if-present | |
| continue-on-error: true | |
| - name: Run cross-platform specific tests | |
| run: npm run test:platform | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-${{ matrix.os }}-node-${{ matrix.node-version }} | |
| path: | | |
| mochawesome-report/ | |
| coverage/ | |
| retention-days: 30 | |
| - name: Generate coverage report | |
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' | |
| run: npm run coverage:ci | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' | |
| continue-on-error: true | |
| with: | |
| file: ./coverage/coverage-final.json | |
| flags: unittests | |
| name: codecov-${{ matrix.os }} | |
| platform-verification: | |
| name: Platform Verification | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify CLI installation | |
| run: | | |
| npm link | |
| npx hana-cli --version | |
| - name: Test platform-specific paths (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Write-Host "Testing Windows-specific features..." | |
| node -e "console.log('Platform:', process.platform); console.log('APPDATA:', process.env.APPDATA)" | |
| - name: Test platform-specific paths (macOS) | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| echo "Testing macOS-specific features..." | |
| node -e "console.log('Platform:', process.platform); console.log('HOME:', process.env.HOME)" | |
| - name: Test platform-specific paths (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| echo "Testing Linux-specific features..." | |
| node -e "console.log('Platform:', process.platform); console.log('HOME:', process.env.HOME)" |