Add plugins matrix job to CI for tsc, lint, prettier, and build #9
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Validate YAML files in argocd/ and catalog/ | |
| run: | | |
| find .github argocd catalog helm techdocs -name '*.yaml' -o -name '*.yml' | while read -r file; do | |
| echo " $file" | |
| yq '.' "$file" > /dev/null | |
| done | |
| - name: Run shellcheck on scripts/ | |
| run: | | |
| echo "Running shellcheck on scripts/..." | |
| find scripts -name '*.sh' | while read -r file; do | |
| echo " $file" | |
| shellcheck "$file" | |
| done | |
| - name: Verify no changes in .github/ | |
| run: | | |
| if [ -n "$(git status --porcelain .github/)" ]; then | |
| echo "::error::Unexpected changes detected in .github/ after CI steps:" | |
| git diff .github/ | |
| exit 1 | |
| fi | |
| echo "No changes in .github/ — OK" | |
| plugins: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| workspace: | |
| - backstage-1.42 | |
| - backstage-1.45 | |
| - backstage-1.49 | |
| - backstage-1.52 | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: plugins/${{ matrix.workspace }}/package.json | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| working-directory: plugins/${{ matrix.workspace }} | |
| - name: TypeScript type check | |
| run: yarn tsc | |
| working-directory: plugins/${{ matrix.workspace }} | |
| - name: Lint | |
| run: yarn lint:all | |
| working-directory: plugins/${{ matrix.workspace }} | |
| # - name: Check formatting | |
| # run: yarn prettier:check | |
| # working-directory: plugins/${{ matrix.workspace }} | |
| - name: Build | |
| run: yarn build:all | |
| working-directory: plugins/${{ matrix.workspace }} | |
| plugins-check: | |
| if: always() | |
| needs: plugins | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2 | |
| with: | |
| egress-policy: audit | |
| - name: Verify all plugin matrix jobs passed | |
| run: | | |
| if [ "${{ needs.plugins.result }}" != "success" ]; then | |
| echo "::error::One or more plugin matrix jobs failed" | |
| exit 1 | |
| fi |