Skip to content

Commit

Permalink
ci: Verific skipping conditional on github.ref
Browse files Browse the repository at this point in the history
Docs jobs should not skip on concurrent jobs (in case a non-docs job is already running, such as when a commit has been tagged for docs-preview).
However, a successful `test-verific` can allow for a future docs job to skip testing and go straight to the preview.
  • Loading branch information
KrystalDelusion committed Sep 2, 2024
1 parent 840c515 commit 1985a6b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/test-verific.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build and run tests with Verific (Linux)

on: [push, pull_request]
# docs builds are needed for anything on main, any tagged versions, and any tag
# or branch starting with docs-preview
env:
is_docs_job: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/docs-preview') || startsWith(github.ref, 'refs/tags/') }}

jobs:
pre-job:
Expand All @@ -15,9 +19,10 @@ jobs:
# don't cancel previous builds
cancel_others: 'false'
# only run on push *or* pull_request, not both
concurrent_skipping: 'same_content_newer'
# we have special actions when running on main, so this should be off
skip_after_successful_duplicate: 'false'
# unless this is a build which needs to run for docs generation
concurrent_skipping: ${{ env.is_docs_job && 'never' || 'same_content_newer' }}
# we can skip testing if it has already passed
skip_after_successful_duplicate: 'true'

test-verific:
needs: pre-job
Expand Down Expand Up @@ -74,7 +79,7 @@ jobs:
prepare-docs:
name: Generate docs artifact
needs: [pre-job, test-verific]
if: needs.pre-job.outputs.should_skip != 'true'
if: needs.pre-job.outputs.should_skip != 'true' || env.is_docs_job
runs-on: [self-hosted, linux, x64, fast]
steps:
- name: Checkout Yosys
Expand Down Expand Up @@ -112,7 +117,7 @@ jobs:
docs/source/code_examples
- name: Trigger RTDs build
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/docs-preview') || startsWith(github.ref, 'refs/tags/') }}
if: ${{ env.is_docs_job }}
uses: dfm/[email protected]
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
Expand Down

0 comments on commit 1985a6b

Please sign in to comment.