Skip to content

build(deps): bump project dependencies #452

build(deps): bump project dependencies

build(deps): bump project dependencies #452

Workflow file for this run

# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: validate-pr
on:
pull_request:
branches: [main]
defaults:
run:
shell: bash
concurrency:
group: ${{ github.ref }}.validate-pr
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.check-projects.outputs.projects }}
projects-build: ${{ steps.check-projects-build.outputs.projects }}
projects-build-storybook: ${{ steps.check-projects-build-storybook.outputs.projects }}
changes: ${{ steps.check-changes.outputs.changes }}
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Validate commit messages
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
run: |
git checkout -b premerge
git fetch origin main:main
npx --no-install commitlint --from main
- name: Validation contribution size
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
uses: ./.github/actions/validate-contribution-size
- name: Check affected projects with target `build`
id: check-projects-build
uses: ./.github/actions/check-projects
with:
affected: 'true'
batch-size: '3'
with-target: 'build'
- name: Check affected projects with target `build-storybook`
id: check-projects-build-storybook
uses: ./.github/actions/check-projects
with:
affected: 'true'
batch-size: '3'
with-target: 'build-storybook'
- name: Check affected projects
id: check-projects
uses: ./.github/actions/check-projects
with:
affected: 'true'
- name: Check changes
id: check-changes
uses: ./.github/actions/check-changes
with:
premerge: 'true'
trunk: 'main'
- name: Set failure
id: check
if: failure()
run: echo "success=$(echo 'false')" >> $GITHUB_OUTPUT
lint:
needs: checks
runs-on: ubuntu-latest
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Lint shell
if: fromJSON(needs.checks.outputs.changes).shelltools == 'true'
run: |
sudo apt install shellcheck
npx nx run tools:lint-shell
- name: Set failure
id: check
if: failure()
run: echo "success=$(echo 'false')" >> $GITHUB_OUTPUT
lint-affected:
needs: checks
if: needs.checks.outputs.projects != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 40
matrix:
projects: ${{ fromJSON(needs.checks.outputs.projects) }}
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Lint ts
run: npx nx run-many --target lint --projects ${{ matrix.projects }}
- name: Lint html
run: npx nx run-many --target prettier-check --dryRun --projects ${{ matrix.projects }}
- name: Lint scss
run: npx nx run-many --target stylelint-check --dryRun --projects ${{ matrix.projects }}
- name: Set failure
id: check
if: failure()
run: echo "success=$(echo 'false')" >> $GITHUB_OUTPUT
test:
needs: checks
runs-on: ubuntu-latest
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
with:
compodoc: true
- name: Documentation coverage
run: npx nx run tools:compodoc-coverage-test
- name: Set failure
id: check
if: failure()
run: echo "success=(echo 'false')" >> $GITHUB_OUTPUT
test-affected:
needs: checks
if: needs.checks.outputs.projects != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 40
matrix:
projects: ${{ fromJSON(needs.checks.outputs.projects) }}
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Compiler check affected
run: npx nx run-many --target tsc-check --projects ${{ matrix.projects }}
- name: Unit test
run: npx nx run-many --target test --pass-with-no-tests --code-coverage --run-in-band --ci --projects ${{ matrix.projects }}
- name: Set failure
id: check
if: failure()
run: echo "success=(echo 'false')" >> $GITHUB_OUTPUT
build:
needs: checks
runs-on: ubuntu-latest
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Build global storybook
if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).storybook == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }}
run: npx nx run documentation:build-storybook
- name: Set failure
id: check
if: failure()
run: echo "success=(echo 'false')" >> $GITHUB_OUTPUT
build-affected:
needs: checks
if: needs.checks.outputs.projects-build != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 40
matrix:
projects: ${{ fromJSON(needs.checks.outputs.projects-build) }}
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Build affected
run: npx nx run-many --target build --projects ${{ matrix.projects }}
- name: Set failure
id: check
if: failure()
run: echo "success=(echo 'false')" >> $GITHUB_OUTPUT
build-affected-storybook:
needs: checks
if: needs.checks.outputs.projects-build-storybook != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 40
matrix:
projects: ${{ fromJSON(needs.checks.outputs.projects-build-storybook) }}
outputs:
success: ${{ steps.check.outputs.success || 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Build storybook affected
run: npx nx run-many --target build-storybook --projects ${{ matrix.projects }}
- name: Set failure
id: check
if: failure()
run: echo "success=(echo 'false')" >> $GITHUB_OUTPUT
premerge:
needs: [checks, lint, lint-affected, test, test-affected, build, build-affected, build-affected-storybook]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check result
run: |
if [[ "$CHECKS_RESULT" != "true" || "$LINT_RESULT" != "true" || "$LINT_AFFECTED_RESULT" != "true" || "$TEST_RESULT" != "true" || "$TEST_AFFECTED_RESULT" != "true" || "$BUILD_RESULT" != "true" || "$BUILD_AFFECTED_RESULT" != "true" || "$BUILD_AFFECTED_STORYBOOK_RESULT" != "true" ]]; then exit 1; fi
echo "### :rocket: Premerge checks succeeded" >> $GITHUB_STEP_SUMMARY
env:
CHECKS_RESULT: ${{ needs.checks.outputs.success }}
LINT_RESULT: ${{ needs.lint.outputs.success }}
LINT_AFFECTED_RESULT: ${{ needs.lint-affected.outputs.success || needs.checks.outputs.projects == '[]' }}
TEST_RESULT: ${{ needs.test.outputs.success }}
TEST_AFFECTED_RESULT: ${{ needs.test-affected.outputs.success || needs.checks.outputs.projects == '[]' }}
BUILD_RESULT: ${{ needs.build.outputs.success }}
BUILD_AFFECTED_RESULT: ${{ needs.build-affected.outputs.success || needs.checks.outputs.projects-build == '[]' }}
BUILD_AFFECTED_STORYBOOK_RESULT: ${{ needs.build-affected-storybook.outputs.success || needs.checks.outputs.projects-build-storybook == '[]' }}