fix: load bundled default includes outside project root #1711
Workflow file for this run
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: | |
| pull_request: | |
| branches: [main, master] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| checks: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20] | |
| 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' # Disabled due to rollup optional dependency bug | |
| - name: Install dependencies | |
| run: | | |
| # Use npm ci for reproducible builds from package-lock.json | |
| rm -rf node_modules | |
| npm ci | |
| # Explicitly install rollup platform-specific binary for Linux | |
| npm install --no-save @rollup/rollup-linux-x64-gnu | |
| - name: Build package | |
| run: npm run build | |
| - name: Lint code | |
| run: npm run lint | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Validate README links | |
| run: npm run docs:validate | |
| - name: Run tests | |
| run: npm test | |
| env: | |
| CI: true | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| - name: Test CLI | |
| run: | | |
| ./dist/index.js --cli --version | |
| ./dist/index.js --cli --help | |
| - name: Test package installation | |
| run: | | |
| npm pack | |
| ls -la *.tgz | |
| echo "✅ Package can be created successfully" | |
| # Visor YAML tests run as part of `npm test` via test:yaml. | |
| # Artifacts are still uploaded below from ./output. | |
| - name: Upload integration test artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visor-test-results | |
| path: | | |
| output/visor-tests.json | |
| output/visor-tests.xml | |
| output/visor-tests.md | |
| - name: Test basic action functionality | |
| uses: ./ | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| owner: 'octocat' | |
| repo: 'Hello-World' | |
| ai-model: 'mock' | |
| ai-provider: 'mock' | |
| config-path: '.visor.test.yaml' | |
| comment-on-pr: 'false' | |
| add-reactions: 'false' | |
| # Verify EE build and run enterprise tests | |
| test-ee: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install OPA CLI | |
| run: | | |
| curl -L -o opa https://openpolicyagent.org/downloads/v1.4.2/opa_linux_amd64_static | |
| chmod +x opa | |
| sudo mv opa /usr/local/bin/opa | |
| opa version | |
| - name: Install dependencies | |
| run: | | |
| rm -rf node_modules | |
| npm ci | |
| npm install --no-save @rollup/rollup-linux-x64-gnu | |
| - name: Build EE package | |
| run: npm run build:ee | |
| - name: Verify enterprise code in bundle | |
| run: | | |
| if grep -q "OpaPolicyEngine" dist/index.js && grep -q "LicenseValidator" dist/index.js; then | |
| echo "✅ EE bundle contains enterprise code" | |
| else | |
| echo "❌ EE bundle is missing enterprise code" | |
| exit 1 | |
| fi | |
| - name: Verify EE CLI starts | |
| run: | | |
| ./dist/index.js --cli --version | |
| ./dist/index.js --cli --help | |
| - name: Run EE tests | |
| run: npm run test:ee | |
| env: | |
| CI: true | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| # Consolidated scenario tests into the main 'test' job to avoid duplication. | |
| # If you need to split later, prefer a matrix or a reusable workflow. |