-
-
Notifications
You must be signed in to change notification settings - Fork 849
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
fix: all test cases not passing for commit on external repository #3838
Open
dipishBisht
wants to merge
6
commits into
asyncapi:master
Choose a base branch
from
dipishBisht:fix/3836
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−127
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
74c521d
All test cases are passing for commit on external repository
dipishBisht c185be3
updated lighthouse yml file
dipishBisht fc34c09
netligy error
dipishBisht 76aecf9
lighthouse test filed resolved
dipishBisht 4253359
change gh_token to github_token
dipishBisht c80bc47
Upload Lighthouse Artifacts
dipishBisht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,51 +14,35 @@ jobs: | |
steps: | ||
- if: > | ||
!github.event.pull_request.draft && !( | ||
(github.actor == 'asyncapi-bot' && ( | ||
startsWith(github.event.pull_request.title, 'ci: update global workflows') || | ||
startsWith(github.event.pull_request.title, 'chore: update code of conduct') || | ||
startsWith(github.event.pull_request.title, 'ci: update global contribution guide') || | ||
startsWith(github.event.pull_request.title, 'ci: update workflows for go projects') || | ||
startsWith(github.event.pull_request.title, 'ci: update workflows for nodejs projects') || | ||
startsWith(github.event.pull_request.title, 'ci: update release-related workflows for nodejs projects') || | ||
startsWith(github.event.pull_request.title, 'ci: update semantic release config file') || | ||
startsWith(github.event.pull_request.title, 'ci: update generic workflows') || | ||
startsWith(github.event.pull_request.title, 'ci: update workflows for docker-based projects') || | ||
startsWith(github.event.pull_request.title, 'chore(release):') | ||
)) || | ||
(github.actor == 'allcontributors[bot]' && | ||
startsWith(github.event.pull_request.title, 'docs: add') | ||
) | ||
github.actor == 'asyncapi-bot' || github.actor == 'allcontributors[bot]' | ||
) | ||
id: should_run | ||
name: Should Run | ||
run: echo "shouldrun=true" >> $GITHUB_OUTPUT | ||
run: echo "shouldrun=true" >> $GITHUB_ENV | ||
|
||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
uses: actions/checkout@v3 | ||
- if: env.shouldrun == 'true' | ||
uses: actions/checkout@v4 | ||
|
||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: env.shouldrun == 'true' | ||
name: Await Netlify Preview | ||
uses: jakepartusch/wait-for-netlify-action@f1e137043864b9ab9034ae3a5adc1c108e3f1a48 #version 1.4 https://github.com/JakePartusch/wait-for-netlify-action/releases/tag/v1.4 | ||
uses: jakepartusch/[email protected] | ||
id: netlify | ||
with: | ||
site_name: asyncapi-website | ||
max_timeout: 600 | ||
|
||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: env.shouldrun == 'true' | ||
name: Lighthouse Audit | ||
id: lighthouse_audit | ||
uses: treosh/lighthouse-ci-action@03becbfc543944dd6e7534f7ff768abb8a296826 #version 10.1 https://github.com/treosh/lighthouse-ci-action/releases/tag/10.1.0 | ||
uses: treosh/[email protected] | ||
with: | ||
urls: | | ||
https://deploy-preview-$PR_NUMBER--asyncapi-website.netlify.app/ | ||
https://deploy-preview-${{ github.event.pull_request.number }}--asyncapi-website.netlify.app/ | ||
configPath: ./.github/workflows/lighthouserc.json | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
env: | ||
PR_NUMBER: ${{ github.event.pull_request.number}} | ||
|
||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: env.shouldrun == 'true' | ||
name: Lighthouse Score Report | ||
id: lighthouse_score_report | ||
uses: actions/github-script@v6 | ||
|
@@ -71,23 +55,20 @@ jobs: | |
Object.keys(result).forEach(key => result[key] = formatResult(result[key])) | ||
const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴' | ||
const comment = [ | ||
`⚡️ [Lighthouse report](${Object.values(links)[0]}) for the changes in this PR:`, | ||
`⚡️ [Lighthouse report](${Object.values(links)[0]}) for this PR:`, | ||
'| Category | Score |', | ||
'| --- | --- |', | ||
`| ${score(result.performance)} Performance | ${result.performance} |`, | ||
`| ${score(result.accessibility)} Accessibility | ${result.accessibility} |`, | ||
`| ${score(result['best-practices'])} Best practices | ${result['best-practices']} |`, | ||
`| ${score(result['best-practices'])} Best Practices | ${result['best-practices']} |`, | ||
`| ${score(result.seo)} SEO | ${result.seo} |`, | ||
`| ${score(result.pwa)} PWA | ${result.pwa} |`, | ||
' ', | ||
`*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*` | ||
`| ${score(result.pwa)} PWA | ${result.pwa} |` | ||
].join('\n') | ||
core.setOutput("comment", comment); | ||
core.setOutput("comment", comment); | ||
|
||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: env.shouldrun == 'true' | ||
name: LightHouse Statistic Comment | ||
id: lighthouse_statistic_comment | ||
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # version 2.8 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.8.0 | ||
uses: marocchino/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
number: ${{ github.event.pull_request.number }} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# This action is centrally managed in https://github.com/asyncapi/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
# Centrally managed in asyncapi/.github repo | ||
name: Lint PR title | ||
|
||
on: | ||
|
@@ -12,35 +10,32 @@ jobs: | |
name: Lint PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Since this workflow is REQUIRED for a PR to be mergable, we have to have this 'if' statement in step level instead of job level. | ||
- if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} | ||
uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 #version 5.2.0 https://github.com/amannn/action-semantic-pull-request/releases/tag/v5.2.0 | ||
- if: > | ||
!contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) | ||
uses: amannn/[email protected] | ||
id: lint_pr_title | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} | ||
with: | ||
subjectPattern: ^(?![A-Z]).+$ | ||
subjectPatternError: | | ||
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. | ||
The subject "{subject}" in the PR title "{title}" should start with a lowercase letter. | ||
|
||
# Comments the error message from the above lint_pr_title action | ||
- if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor)}} | ||
- if: ${{ always() && steps.lint_pr_title.outputs.error_message != null }} | ||
name: Comment on PR | ||
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 | ||
uses: marocchino/[email protected] | ||
with: | ||
header: pr-title-lint-error | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} | ||
message: | | ||
|
||
We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). | ||
More details 👇🏼 | ||
We require all PRs to follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message}} | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
# deletes the error comment if the title is correct | ||
|
||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
name: delete the comment | ||
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 | ||
name: Delete PR title lint comment | ||
uses: marocchino/[email protected] | ||
with: | ||
header: pr-title-lint-error | ||
delete: true | ||
|
This file contains 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 file contains 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 file contains 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Setting Environment Variable for 'shouldrun'.
Using
$GITHUB_ENV
to setshouldrun
is consistent with our updated practices. Please check and remove any trailing spaces that might be present after this command to satisfy YAML linting requirements.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 22-22: trailing spaces
(trailing-spaces)