Skip to content

Add plugins matrix job to CI for tsc, lint, prettier, and build (#15) #2

Add plugins matrix job to CI for tsc, lint, prettier, and build (#15)

Add plugins matrix job to CI for tsc, lint, prettier, and build (#15) #2

Workflow file for this run

name: CI plugins
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
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 }}
- 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-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