-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Verific skipping conditional on github.ref
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
1 parent
840c515
commit 1985a6b
Showing
1 changed file
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 }} | ||
|