Skip to content

Commit

Permalink
ci: skip unnecessary test runs for bot-generated and non-critical PRs (
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaP700 authored Jan 29, 2025
1 parent 5f49fa0 commit ee36155
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/pr-testing-with-test-project.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#This workflow runs the tests in the test projects to make sure the generator works as a library where it is a Node dependency along with the template.
# This workflow runs the tests in the test projects to make sure the generator works as a library where it is a Node dependency along with the template.
name: Test using test project

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- 'package.json'
- 'package-lock.json'
- 'apps/**'
- 'packages/**'
- '.github/workflows/**'
- '!**/*.md'
- '!docs/**'

jobs:
test:
Expand All @@ -16,6 +24,27 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run test

- name: Determine if tests should run
id: should_run
if: >
!github.event.pull_request.draft && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'asyncapi-bot-eve' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors[bot]' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
shell: bash

- if: steps.should_run.outputs.shouldrun == 'true'
name: Run test
run: NODE_IMAGE_TAG=${{ matrix.node }} docker compose up --abort-on-container-exit --remove-orphans --force-recreate
working-directory: ./apps/generator/test/test-project
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is a Monorepo managed using [Turborepo](https://turbo.build/) and contains

1. [Hooks](apps/hooks): This library contains generator filters that can be reused across multiple templates, helping to avoid redundant work. Hooks are designed to let template developers hook into the template generation process. For example, one can create a hook code that will be automatically invoked right after the template generation process has ended.

1. [Nunjucks-filters](apps/nunjucks-filters): This library contains generator filters that can be reused across multiple templates, helping to avoid redundant work. These filters are designed specifically for Nunjucks templates and are included by default with the generator, so there's no need to add them to dependencies separately.
1. [Nunjucks-filters](apps/nunjucks-filters): This library contains generator filters that can be reused across multiple templates helping to avoid redundant work. These filters are designed specifically for Nunjucks templates and are included by default with the generator, so there's no need to add them to dependencies separately.

> [!IMPORTANT]
> **Deprecation Notice:** The Nunjucks renderer engine is deprecated and will be removed in future releases. We strongly recommend using the React renderer engine instead. You can find how to migrate from Nunjucks to React in the [migration guide](apps/generator/docs/nunjucks-depreciate.md)
Expand Down

0 comments on commit ee36155

Please sign in to comment.