Skip to content

Commit

Permalink
chore(gh): update/remove gh actions (#2416)
Browse files Browse the repository at this point in the history
* chore(gh): update/remove gh actions

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix script typo

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* merge pr tests into one file

Signed-off-by: Paul Schultz <pschultz@pobox.com>

---------

Signed-off-by: Paul Schultz <pschultz@pobox.com>
  • Loading branch information
schultzp2020 authored Oct 22, 2024
1 parent 7611337 commit cf7c430
Show file tree
Hide file tree
Showing 21 changed files with 331 additions and 514 deletions.
15 changes: 0 additions & 15 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ inputs:
runs:
using: 'composite'
steps:
- name: Check if workspace is dirty
shell: bash
run: |
changed_files="$(git diff --name-only . || true)"
if [[ $changed_files ]]; then
echo "After 'yarn install', workspace is dirty! The following files have changed:"
echo
echo "$changed_files"
echo
echo "Look for an existing pull request at: https://github.com/janus-idp/backstage-plugins/pulls?q=is%3Apr+regen+author%3Aapp%2Fjanus-idp"
echo "If none found, regenerate yarn.lock at: https://github.com/janus-idp/backstage-plugins/actions/workflows/yarn-lock.yaml"
echo
exit 42
fi
- name: Run prettier
shell: bash
run: yarn prettier:check --concurrency=75% ${{ inputs.args }}
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/pr-build.yaml

This file was deleted.

112 changes: 0 additions & 112 deletions .github/workflows/pr-playwright.yaml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/pr-test.yaml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Pull Request

on: pull_request

env:
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
TURBO_SCM_HEAD: ${{ github.sha }}

# enforce only one action can run at a time for a given PR, and
# when updating a PR, actions in progress will be cancelled to start a fresh one
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build with Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

- name: Install dependencies
run: |
yarn install
- name: Build packages
uses: ./.github/actions/build
with:
args: --affected

test:
name: Test with Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

- name: Install dependencies
run: |
yarn install
- name: Verify changesets
if: startsWith(github.ref_name, 'changeset-release/')
run: |
yarn changeset status --since=${{ github.event.pull_request.base.sha }}
- name: Test packages
uses: ./.github/actions/test
with:
args: --affected

ui-test:
name: UI Tests with Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1

- name: Install dependencies
run: |
yarn install
- name: Install playwright
run: npx playwright install --with-deps chromium

- name: Run tests
run: |
# enable permission support and RBAC plugins
printf "\npermission:\n enabled: true\n" >> $(pwd)/app-config.yaml
yarn run ui-test --affected
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
if: !cancelled()
with:
name: playwright-report
path: plugins/*/playwright-report/
retention-days: 1
Loading

0 comments on commit cf7c430

Please sign in to comment.