Browse Source
chore: fix argos-ci check status in PR (#35193)
* chore: batch upload argos-ci snapshots
* test: added commit and branch back for ui-upload.yml
pull/35192/head
afc163
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
55 additions and
3 deletions
-
.github/workflows/ui-upload.yml
-
.github/workflows/ui.yml
-
scripts/argos-upload.js
|
|
@ -23,6 +23,26 @@ jobs: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: Download commit artifact |
|
|
|
uses: dawidd6/action-download-artifact@v2 |
|
|
|
with: |
|
|
|
workflow: ${{ github.event.workflow_run.workflow_id }} |
|
|
|
name: commit |
|
|
|
|
|
|
|
- name: Save commit id |
|
|
|
id: commit |
|
|
|
run: echo "::set-output name=id::$(<commit.txt)" |
|
|
|
|
|
|
|
- name: Download branch artifact |
|
|
|
uses: dawidd6/action-download-artifact@v2 |
|
|
|
with: |
|
|
|
workflow: ${{ github.event.workflow_run.workflow_id }} |
|
|
|
name: branch |
|
|
|
|
|
|
|
- name: Save branch id |
|
|
|
id: branch |
|
|
|
run: echo "::set-output name=id::$(<branch.txt)" |
|
|
|
|
|
|
|
- name: Download snapshots artifact |
|
|
|
uses: dawidd6/action-download-artifact@v2 |
|
|
|
with: |
|
|
@ -39,3 +59,5 @@ jobs: |
|
|
|
run: npm run argos |
|
|
|
env: |
|
|
|
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }} |
|
|
|
ARGOS_GITHUB_BRANCH: ${{ steps.branch.outputs.id }} |
|
|
|
ARGOS_GITHUB_COMMIT: ${{ steps.commit.outputs.id }} |
|
|
|
|
|
@ -58,3 +58,33 @@ jobs: |
|
|
|
name: snapshots |
|
|
|
path: imageSnapshots/ |
|
|
|
retention-days: 3 |
|
|
|
|
|
|
|
- name: Save commit |
|
|
|
if: github.event_name == 'pull_request' && github.base_ref == 'master' |
|
|
|
run: echo ${{ github.event.pull_request.head.sha }} > ./commit.txt |
|
|
|
|
|
|
|
- name: Save commit |
|
|
|
if: github.event_name == 'push' |
|
|
|
run: echo ${{ github.sha }} > ./commit.txt |
|
|
|
|
|
|
|
- name: Upload commit |
|
|
|
if: ${{ always() }} |
|
|
|
uses: actions/upload-artifact@v3 |
|
|
|
with: |
|
|
|
name: commit |
|
|
|
path: ./commit.txt |
|
|
|
|
|
|
|
- name: Save branch |
|
|
|
if: github.event_name == 'pull_request' && github.base_ref == 'master' |
|
|
|
run: echo pull/${{ github.event.pull_request.number }}/merge > ./branch.txt |
|
|
|
|
|
|
|
- name: Save branch |
|
|
|
if: github.event_name == 'push' |
|
|
|
run: echo ${GITHUB_REF##*/} > ./branch.txt |
|
|
|
|
|
|
|
- name: Upload branch |
|
|
|
if: ${{ always() }} |
|
|
|
uses: actions/upload-artifact@v3 |
|
|
|
with: |
|
|
|
name: branch |
|
|
|
path: ./branch.txt |
|
|
|
|
|
@ -47,11 +47,11 @@ async function run() { |
|
|
|
'--batchCount', |
|
|
|
chunks.length, |
|
|
|
'--branch', |
|
|
|
process.env.GITHUB_REF_NAME, |
|
|
|
process.env.ARGOS_GITHUB_BRANCH, |
|
|
|
'--commit', |
|
|
|
process.env.GITHUB_SHA, |
|
|
|
process.env.ARGOS_GITHUB_COMMIT, |
|
|
|
'--external-build-id', |
|
|
|
process.env.GITHUB_SHA, |
|
|
|
process.env.ARGOS_GITHUB_COMMIT, |
|
|
|
]); |
|
|
|
// eslint-disable-next-line no-console -- pipe stdout
|
|
|
|
console.log(argosResults.stdout); |
|
|
|