Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: integrate dorny/paths-filter into PR test workflow #1352

Merged
merged 28 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
150c70f
fix: skip unnecessary test runs for bot-generated and non-critical PRs
AdityaP700 Jan 23, 2025
3b869ba
Merge branch 'master' into fix/skip-unnecessary-tests
AdityaP700 Jan 23, 2025
3c929b0
Merge pull request #2 from AdityaP700/fix/skip-unnecessary-tests
AdityaP700 Jan 23, 2025
fbe5518
chore: update README.md for testing
AdityaP700 Jan 23, 2025
6b99a12
Merge pull request #3 from AdityaP700/test/readme
AdityaP700 Jan 23, 2025
ae3ed1c
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
745ad20
Merge pull request #5 from AdityaP700/fix/skip-unnecessary-tests
AdityaP700 Jan 23, 2025
4a5a876
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
7a9cd96
Merge pull request #6 from AdityaP700/fix/skip-unnecessary-tests
AdityaP700 Jan 23, 2025
da527e7
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
8166815
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
45a3500
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
1fdb0fa
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
eac63d3
Update pr-testing-with-test-project.yml
AdityaP700 Jan 23, 2025
735aefc
fix: skip unnecessary test runs for bot-generated and non-critical PRs
AdityaP700 Jan 23, 2025
b7232dd
feat(ci): integrate dorny/paths-filter for PR test control
AdityaP700 Jan 29, 2025
f52da65
feat(ci): integrate dorny/paths-filter for PR test control
AdityaP700 Jan 29, 2025
32eae21
Merge branch 'chore/update-ci-workflow' of https://github.com/AdityaP…
AdityaP700 Jan 29, 2025
67974aa
deleted:unwanted-file.js
AdityaP700 Jan 29, 2025
74df44c
removed changes in README.md
AdityaP700 Jan 29, 2025
bf49513
commited the changes
AdityaP700 Jan 29, 2025
9fb6173
edited the part
AdityaP700 Jan 29, 2025
e57239c
feat(ci): integrate dorny/paths-filter for PR test control
AdityaP700 Jan 29, 2025
c9a1a13
Merge branch 'chore/update-ci-workflow' of https://github.com/AdityaP…
AdityaP700 Jan 29, 2025
5b06829
Merge branch 'master' into chore/update-ci-workflow
AdityaP700 Jan 29, 2025
89ca8ab
Added : commitId for the release of v3.0.2
AdityaP700 Jan 30, 2025
586a5b8
Merge branch 'chore/update-ci-workflow' of https://github.com/AdityaP…
AdityaP700 Jan 30, 2025
e6ddc00
Added : commitId of both the releases
AdityaP700 Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions .github/workflows/pr-testing-with-test-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,57 @@ 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:
changes:
runs-on: ubuntu-latest
outputs:
should_test: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 https://github.com/actions/checkout/releases/tag/v3
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 https://github.com/dorny/paths-filter/releases/tag/v3.0.2
id: filter
with:
filters: |
changes:
- 'package.json'
- 'package-lock.json'
- 'apps/**'
- 'packages/**'
- '.github/workflows/**'
- '!**/*.md'
- '!docs/**'

test:
if: github.event.pull_request.draft == false
needs: changes
if: ${{ needs.changes.outputs.should_test == 'true' && github.event.pull_request.draft == false }}
name: Test generator as dependency with Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: ["18", "20"]
steps:
- name: Checkout repository
uses: actions/checkout@v3

uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- 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):')
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):')
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')
(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
working-directory: ./apps/generator/test/test-project