[DEVX] Updates Backstage catalog files. #101
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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: On Pull Request | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- main | |
- next | |
jobs: | |
install: | |
if: github.event.pull_request.state != 'closed' | |
runs-on: ubuntu-latest | |
outputs: | |
cache-hit: ${{ steps.cache-dependencies.outputs.cache-hit }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node 22 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Cache dependencies and workspace | |
id: cache-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.yarn/cache | |
~/.cache/yarn | |
node_modules | |
plugins/*/node_modules | |
packages/*/node_modules | |
libs/*/node_modules | |
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/yarn.lock', '**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-dependencies- | |
- name: Install yarn | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: corepack enable | |
- name: Set yarn version to latest stable | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: corepack prepare yarn@stable --activate | |
- name: Install dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: yarn install | |
build-and-test: | |
if: github.event.pull_request.state != 'closed' | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node 22 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore dependencies cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.yarn/cache | |
~/.cache/yarn | |
node_modules | |
plugins/*/node_modules | |
packages/*/node_modules | |
libs/*/node_modules | |
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/yarn.lock', '**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-dependencies- | |
- name: Install yarn | |
run: corepack enable | |
- name: Set yarn version to latest stable | |
run: corepack prepare yarn@stable --activate | |
- name: Build | |
run: yarn build | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files_yaml: | | |
backstage-plugin: | |
- plugins/backstage-plugin/** | |
backstage-plugin-backend: | |
- plugins/backstage-plugin-backend/** | |
backstage-plugin-entity-processor: | |
- plugins/backstage-plugin-entity-processor/** | |
backstage-plugin-scaffolder-actions: | |
- plugins/backstage-plugin-scaffolder-actions/** | |
- name: Test backstage-plugin | |
if: steps.changed-files.outputs.backstage-plugin_any_changed == 'true' | |
run: yarn workspace @pagerduty/backstage-plugin test | |
- name: Test backstage-plugin-backend | |
if: steps.changed-files.outputs.backstage-plugin-backend_any_changed == 'true' | |
run: yarn workspace @pagerduty/backstage-plugin-backend test | |
- name: Test backstage-plugin-entity-processor | |
if: steps.changed-files.outputs.backstage-plugin-entity-processor_any_changed == 'true' | |
run: yarn workspace @pagerduty/backstage-plugin-entity-processor test | |
- name: Test backstage-plugin-scaffolder-actions | |
if: steps.changed-files.outputs.backstage-plugin-scaffolder-actions_any_changed == 'true' | |
run: yarn workspace @pagerduty/backstage-plugin-scaffolder-actions test | |
lint: | |
if: github.event.pull_request.state != 'closed' | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node 22 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore dependencies cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.yarn/cache | |
~/.cache/yarn | |
node_modules | |
plugins/*/node_modules | |
packages/*/node_modules | |
libs/*/node_modules | |
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/yarn.lock', '**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-dependencies- | |
- name: Install yarn | |
run: corepack enable | |
- name: Set yarn version to latest stable | |
run: corepack prepare yarn@stable --activate | |
- name: Lint | |
run: yarn lint |