Merge pull request #123 from rockygeekz/fix/sonarcloud-test-assertions #456
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install system dependencies | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq libsecret-1-dev xvfb | |
| - name: Cache build tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build-tools | |
| key: build-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.node-version', 'bootstrap.sh') }} | |
| - name: Bootstrap | |
| run: ./bootstrap.sh | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: npm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: npm-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Check no query-string secrets | |
| run: npm run check:no-query-secrets | |
| - name: Disable GPU acceleration | |
| run: | | |
| mkdir -p ~/.vscode | |
| echo '{ "disable-hardware-acceleration": true }' > ~/.vscode/argv.json | |
| - name: Test (daemon – with coverage) | |
| run: xvfb-run -a npm run test:coverage --workspace=packages/daemon | |
| - name: Test (vscode) | |
| run: xvfb-run -a npm test --workspace=packages/vscode | |
| - name: Upload coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: packages/daemon/coverage/lcov.info | |
| flags: daemon | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload coverage for SonarCloud | |
| if: hashFiles('packages/daemon/coverage/lcov.info') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sonar-coverage | |
| path: packages/daemon/coverage/lcov.info | |
| retention-days: 7 | |
| build: | |
| needs: lint-and-test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| - runner: ubuntu-24.04-arm | |
| platform: linux | |
| arch: arm64 | |
| - runner: macos-latest | |
| platform: darwin | |
| arch: arm64 | |
| - runner: windows-latest | |
| platform: win32 | |
| arch: x64 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq libsecret-1-dev | |
| - name: Cache build tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build-tools | |
| key: build-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.node-version', 'bootstrap.sh') }} | |
| - name: Bootstrap | |
| shell: bash | |
| run: ./bootstrap.sh | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: npm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: npm-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run ci:build | |
| - name: Smoke test @abbenay/core | |
| run: node --input-type=module -e "import { CoreState } from './index.js'" | |
| working-directory: packages/daemon/dist/core | |
| - name: Smoke test Windows daemon IPC | |
| if: matrix.platform == 'win32' | |
| run: npm run ci:smoke-win32-ipc | |
| - name: Upload SEA artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: abbenay-daemon-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: dist/${{ matrix.platform }}-${{ matrix.arch }}/ | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: abbenay-vsix-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: packages/vscode/*.vsix | |
| package-python: | |
| needs: lint-and-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cache build tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build-tools | |
| key: build-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.node-version', 'bootstrap.sh') }} | |
| - name: Bootstrap | |
| run: ./bootstrap.sh | |
| - name: Build Python wheel | |
| run: npm run ci:package-python | |
| - name: Upload Python artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: abbenay-client-python | |
| path: packages/python/dist/ |