Skip to content

Operarations widget import #13

Operarations widget import

Operarations widget import #13

Workflow file for this run

name: PR Component CI
on:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for git diff
- name: Detect changed packages
id: set-matrix
run: |
git fetch origin main
components=$(git diff --name-only origin/main...HEAD | grep '^packages/' | cut -d '/' -f2 | sort -u | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "matrix={\"component\": $components}" >> $GITHUB_OUTPUT
shell: bash
test-components:
needs: detect-changes
runs-on: ubuntu-latest
if: fromJson(needs.detect-changes.outputs.matrix).component != '[]'
strategy:
matrix: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
name: Test ${{ matrix.component }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install root dependencies
run: npm install
- name: Lint ${{ matrix.component }}
run: npx eslint ./packages/${{ matrix.component }} --quiet
- name: Test ${{ matrix.component }}
run: npm run test packages/${{ matrix.component }}
- name: Build ${{ matrix.component }}
run: npm run build packages/${{ matrix.component }}
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.component }}-build
path: packages/${{ matrix.component }}/dist
if-no-files-found: warn
retention-days: 5