-
Notifications
You must be signed in to change notification settings - Fork 20
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
plasma-infra: Handle external pull request #844
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6dafdf4
ci: pass ref to publish-common workflow [no ci]
Yakutoc 2c38156
ci: pass ref to "Change detection" workflow [no ci]
Yakutoc ea180a8
ci(publish-canary): handle external pull request [no ci]
Yakutoc e67711b
ci(publish-rc): handle external pull request [no ci]
Yakutoc 7f374cf
ci(docs): handle external pull request [no ci]
Yakutoc 8d3b962
ci(performance-testing): handle external pull request
Yakutoc f3e3f11
ci: clean up by close pull_request_target [no ci]
Yakutoc 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
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 |
---|---|---|
|
@@ -3,24 +3,32 @@ name: PR Documentation and Storybook | |
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
- master | ||
pull_request_target: | ||
branches: | ||
- dev | ||
|
||
concurrency: | ||
# New commit on branch cancels running workflows of the same branch | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
authorize: | ||
name: Authorize external pull request | ||
uses: ./.github/workflows/authorize-external-pr.yml | ||
|
||
scope: | ||
needs: [ authorize ] | ||
uses: ./.github/workflows/change-detection.yml | ||
with: | ||
as-enumeration: true | ||
ref: refs/pull/${{github.event.pull_request.number}}/merge | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Вот здесь ручное выставление Но теперь из-за того как работает |
||
secrets: inherit | ||
|
||
build: | ||
name: Build | ||
needs: scope | ||
needs: [ authorize, scope ] | ||
if: ${{ needs.scope.outputs.HAS_DOCUMENTATION_CHANGED == 'true' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -30,11 +38,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
|
||
show-progress: false | ||
ref: refs/pull/${{github.event.pull_request.number}}/merge | ||
|
||
- name: Prepare environment | ||
uses: ./.github/actions/prepare-environment | ||
|
||
- name: Computed scope | ||
id: scope | ||
uses: actions/github-script@v6 | ||
|
@@ -46,19 +55,19 @@ jobs: | |
const { ENUMERATION } = process.env; | ||
|
||
const enumeration = JSON.parse(JSON.parse(ENUMERATION)); | ||
|
||
if (!enumeration.includes('plasma-core')) { | ||
enumeration.push('plasma-core'); | ||
} | ||
|
||
if (!enumeration.includes('plasma-hope')) { | ||
enumeration.push('plasma-hope'); | ||
} | ||
|
||
if (!enumeration.includes('plasma-new-hope')) { | ||
enumeration.push('plasma-new-hope'); | ||
} | ||
|
||
if (!enumeration.includes('plasma-tokens-utils')) { | ||
enumeration.push('plasma-tokens-utils'); | ||
} | ||
|
@@ -87,81 +96,81 @@ jobs: | |
enumeration.push('plasma-web'); | ||
} | ||
|
||
return enumeration.join(','); | ||
|
||
return enumeration.join(','); | ||
- name: Lerna bootstrap | ||
run: npx lerna bootstrap --scope=@salutejs/{${{steps.scope.outputs.result}}} | ||
|
||
- name: Prepare directory | ||
run: mkdir -p s3_build/${PR_NAME} | ||
|
||
# TODO: https://github.com/salute-developers/plasma/issues/603 | ||
- name: Plasma Website | ||
run: | | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
npm run build --prefix="./website/plasma-website" | ||
cp -R ./website/plasma-website/build/. ./s3_build/${PR_NAME} | ||
|
||
- name: Plasma UI Docs | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_UI_DOCS == 'true' && needs.scope.outputs.HAS_PLASMA_UI == 'true' }} | ||
run: | | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
npm run build --prefix="./website/plasma-ui-docs" | ||
cp -R ./website/plasma-ui-docs/build ./s3_build/${PR_NAME}/ui | ||
|
||
- name: Plasma Web Docs | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_WEB_DOCS == 'true' }} | ||
run: | | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
npm run build --prefix="./website/plasma-web-docs" | ||
cp -R ./website/plasma-web-docs/build ./s3_build/${PR_NAME}/web | ||
|
||
- name: Plasma Web Temple | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_TEMPLE_DOCS == 'true' && needs.scope.outputs.HAS_PLASMA_TEMPLE == 'true' }} | ||
run: | | ||
export NODE_OPTIONS=--openssl-legacy-provider | ||
npm run build --prefix="./website/plasma-temple-docs" | ||
cp -R ./website/plasma-temple-docs/build ./s3_build/${PR_NAME}/temple | ||
|
||
- name: Plasma UI Storybook | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_UI == 'true' }} | ||
run: | | ||
npm run storybook:build --prefix="./packages/plasma-ui" | ||
cp -R ./packages/plasma-ui/build-sb ./s3_build/${PR_NAME}/ui-storybook | ||
|
||
- name: Plasma Web Storybook | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_WEB == 'true' }} | ||
run: | | ||
npm run storybook:build --prefix="./packages/plasma-web" | ||
cp -R ./packages/plasma-web/build-sb ./s3_build/${PR_NAME}/web-storybook | ||
|
||
- name: Plasma B2C Storybook | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_B2C == 'true' }} | ||
run: | | ||
npm run storybook:build --prefix="./packages/plasma-b2c" | ||
cp -R ./packages/plasma-b2c/build-sb ./s3_build/${PR_NAME}/b2c-storybook | ||
|
||
- name: Plasma Temple Storybook | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_TEMPLE == 'true' }} | ||
run: | | ||
npm run storybook:build --prefix="./packages/plasma-temple" | ||
cp -R ./packages/plasma-temple/build-sb ./s3_build/${PR_NAME}/temple-storybook | ||
|
||
- name: Plasma "New Hope" Storybook | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_HOPE == 'true' }} | ||
run: | | ||
npm run storybook:build --prefix="./packages/plasma-new-hope" | ||
cp -R ./packages/plasma-new-hope/build-sb ./s3_build/${PR_NAME}/new-hope-storybook | ||
|
||
- name: Plasma "ASDK" Storybook | ||
if: ${{ needs.scope.outputs.HAS_PLASMA_ASDK == 'true' }} | ||
run: | | ||
npm run storybook:build --prefix="./packages/plasma-asdk" | ||
cp -R ./packages/plasma-asdk/build-sb ./s3_build/${PR_NAME}/asdk-storybook | ||
|
||
- name: Install s3cmd | ||
run: pip3 install s3cmd | ||
|
||
- name: s3 Upload builds | ||
run: > | ||
s3cmd | ||
|
@@ -176,7 +185,7 @@ jobs: | |
sync | ||
./s3_build/${PR_NAME}/ | ||
s3://${{ secrets.AWS_S3_BUCKET_2 }}/pr/${PR_NAME}/ | ||
|
||
- name: Post success comment | ||
uses: actions/github-script@v6 | ||
env: | ||
|
@@ -190,10 +199,10 @@ jobs: | |
github-token: ${{secrets.GH_TOKEN}} | ||
script: | | ||
const { HAS_PLASMA_B2C, HAS_PLASMA_WEB, HAS_PLASMA_UI, HAS_PLASMA_TEMPLE, HAS_PLASMA_HOPE, HAS_PLASMA_ASDK } = process.env; | ||
const { | ||
issue: { number }, | ||
repo: { owner, repo } | ||
|
||
const { | ||
issue: { number }, | ||
repo: { owner, repo } | ||
} = context; | ||
|
||
const links = [ | ||
|
@@ -223,7 +232,7 @@ jobs: | |
if (HAS_PLASMA_ASDK === 'true') { | ||
links.push(`asdk storybook: http://plasma.sberdevices.ru/pr/pr-${number}/asdk-storybook/`) | ||
} | ||
|
||
github.rest.issues.createComment({ | ||
issue_number: number, | ||
owner, | ||
|
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.
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.
а что значит ручное выставление рефки на репозиторий?
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.
@Yeti-or
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.
ручками: типа в конфиге опция которую надо задать?