Skip to content

Commit

Permalink
chore: CI: avoid skipped dependencies hellhole
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Oct 14, 2022
1 parent cf24f55 commit f7651de
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Expand Up @@ -17,15 +17,16 @@ concurrency:

jobs:
set-nightly:
# don't schedule nightlies on forks
if: github.event_name == 'schedule' && github.repository == 'leanprover/lean4'
runs-on: ubuntu-latest
outputs:
nightly: ${{ steps.set.outputs.nightly }}
steps:
- name: Checkout
uses: actions/checkout@v2
# don't schedule nightlies on forks
if: github.event_name == 'schedule' && github.repository == 'leanprover/lean4'
- name: Set Nightly
if: github.event_name == 'schedule' && github.repository == 'leanprover/lean4'
id: set
run: |
if [[ -n '${{ secrets.PUSH_NIGHTLY_TOKEN }}' ]]; then
Expand All @@ -40,8 +41,7 @@ jobs:
build:
needs: set-nightly
# `failure` to continue even after a dependency was skipped
if: (success() || failure()) && (github.event_name != 'schedule' || github.repository == 'leanprover/lean4')
if: github.event_name != 'schedule' || github.repository == 'leanprover/lean4'
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down Expand Up @@ -233,11 +233,7 @@ jobs:
run: ccache -s

release:
# When GitHub says "If a job fails, all jobs that need it are skipped unless
# the jobs use a conditional expression that causes the job to continue.", don't believe
# their lies. It's actually the entire closure (i.e. including `set-nightly`) that
# must succeed for subsequent to be run without the conditional.
if: (success() || failure()) && needs.build.result == 'success' && startsWith(github.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build
steps:
Expand Down

0 comments on commit f7651de

Please sign in to comment.