Skip to content

Commit

Permalink
fix spaces comment and remove echos (#7373)
Browse files Browse the repository at this point in the history
* remove unnecessary condition for deployment workflow

* remove unnecessary echo statements in GitHub Actions workflows

* fix website ci

* add condition to only run comment-spaces-start workflow if changes workflow outputs 'should_run' as 'true'
  • Loading branch information
pngwn authored Feb 9, 2024
1 parent f35f615 commit d56bb28
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 40 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/deploy+test-visual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ jobs:
type: "visual"
token: ${{ secrets.GITHUB_TOKEN }}
name: "UI Tests"
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"


comment-chromatic-start:
uses: "./.github/workflows/comment-queue.yml"
needs: changes
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/deploy-spaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
source_repo: ${{ steps.changes.outputs.source_repo }}
merge_sha: ${{ steps.changes.outputs.merge_sha }}
mergeable: ${{ steps.changes.outputs.mergeable }}
found_pr: ${{ steps.changes.outputs.found_pr }}
steps:
- uses: actions/checkout@v4
- uses: "gradio-app/gradio/.github/actions/changes@main"
Expand All @@ -34,13 +35,11 @@ jobs:
name: "deploy / spaces"
token: ${{ secrets.GITHUB_TOKEN }}
commit_status: false
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"

comment-spaces-start:
needs: changes
uses: "./.github/workflows/comment-queue.yml"
if: ${{ needs.changes.outputs.should_run == 'true' }}
secrets:
gh_token: ${{ secrets.COMMENT_TOKEN }}
with:
Expand Down Expand Up @@ -127,10 +126,7 @@ jobs:
comment-spaces-success:
uses: "./.github/workflows/comment-queue.yml"
needs: [deploy-spaces, changes]
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' &&
needs.deploy-spaces.result == 'success'
if: needs.deploy-spaces.result == 'success' && needs.changes.outputs.found_pr == 'true'
secrets:
gh_token: ${{ secrets.COMMENT_TOKEN }}
with:
Expand All @@ -149,7 +145,7 @@ jobs:
comment-spaces-failure:
uses: "./.github/workflows/comment-queue.yml"
needs: [deploy-spaces, changes]
if: always() && needs.deploy-spaces == 'failure'
if: always() && needs.deploy-spaces == 'failure' && needs.changes.outputs.found_pr == 'true'
secrets:
gh_token: ${{ secrets.COMMENT_TOKEN }}
with:
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
type: "website"
token: ${{ secrets.GITHUB_TOKEN }}
commit_status: false
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"

comment-deploy-start:
needs: changes
uses: "./.github/workflows/comment-queue.yml"
Expand Down Expand Up @@ -78,12 +74,6 @@ jobs:
aws s3 cp ./js/_website/src/lib/json/ s3://gradio-docs-json/$version/ --recursive
- name: Install Vercel CLI
run: pnpm install --global vercel@latest
- name: echo outputs
run: |
echo "source_repo=${{ needs.changes.outputs.source_repo }}"
echo "source_branch=${{ needs.changes.outputs.source_branch }}"
echo "found_pr=${{ needs.changes.outputs.found_pr }}"
echo "pr_number=${{ needs.changes.outputs.pr_number }}"
# preview
- name: Pull Vercel Environment Information
shell: bash
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/generate-changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ jobs:
uses: gradio-app/github/actions/find-pr@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"

comment-changes-start:
uses: "./.github/workflows/comment-queue.yml"
needs: get-pr
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test-hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ jobs:
with:
type: "all"
token: ${{ secrets.GITHUB_TOKEN }}
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"

test-hygiene:
name: "test-hygiene"
runs-on: ubuntu-latest
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
type: "gradio"
name: "test / python / linux"
token: ${{ secrets.GITHUB_TOKEN }}
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"


test-python:
needs: [changes]
if: needs.changes.outputs.should_run == 'true'
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/tests-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
with:
type: "js"
token: ${{ secrets.GITHUB_TOKEN }}
- name: echo github context
if: always()
run: echo "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"

test-js:
needs: changes
if: needs.changes.outputs.should_run == 'true'
Expand Down

0 comments on commit d56bb28

Please sign in to comment.