Skip to content

Commit

Permalink
Add dry_run arg to nightly workflow
Browse files Browse the repository at this point in the history
commit-id:707851ae
  • Loading branch information
maciektr committed Nov 2, 2023
1 parent 3493e73 commit c115ec0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Nightly

on:
workflow_dispatch:
inputs:
dry_run:
description: "Dry run"
type: boolean
default: true
schedule:
- cron: '0 0 * * 3,6'

Expand Down Expand Up @@ -44,11 +49,11 @@ jobs:
NIGHTLY_TAG=$(cargo xtask get-nightly-version --tag)
NIGHTLY_VERSION=$(cargo xtask get-nightly-version)
NIGHTLY_BRANCH="nightly/tmp/$NIGHTLY_TAG"
echo "NIGHTLY_TAG=$NIGHTLY_TAG" >> $GITHUB_ENV
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_ENV
echo "NIGHTLY_BRANCH=$NIGHTLY_BRANCH" >> $GITHUB_ENV
echo "nightly_tag=$NIGHTLY_TAG" >> $GITHUB_OUTPUT
echo "nightly_version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT
echo "nightly_branch=$NIGHTLY_BRANCH" >> $GITHUB_OUTPUT
Expand All @@ -64,7 +69,7 @@ jobs:

- name: Commit patches
run: |
git checkout -b ${{ env.NIGHTLY_BRANCH }}
git checkout -b ${{ env.NIGHTLY_BRANCH }}
git add .
git commit -m ${{ env.NIGHTLY_TAG }}
Expand All @@ -89,6 +94,8 @@ jobs:
upload:
runs-on: ubuntu-latest
needs: [ prepare, release ]
# Do not run on dry_run
if: ${{ !(inputs.dry_run) }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -163,7 +170,8 @@ jobs:
notify_failed:
runs-on: ubuntu-latest
if: always() && contains(needs.*.result, 'failure')
# Do not run on dry_run or success
if: ${{ !(inputs.dry_run) }} && contains(needs.*.result, 'failure')
needs: [ cleanup, upload, release, check, prepare ]
steps:
- name: Notifying about Nightly fail!
Expand Down

0 comments on commit c115ec0

Please sign in to comment.