forked from nim-works/nimskull
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
24 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 |
---|---|---|
|
@@ -27,12 +27,26 @@ on: | |
merge_group: | ||
# Test all additions to merge queue | ||
|
||
workflow_call: | ||
# Allow the workflow to be reused elsewhere | ||
|
||
# Run every script actions in bash | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
cancel: | ||
if: github.event == 'merge_group' || github.event == 'pull_request' | ||
name: Cancel previous runs (Merge Queue/PR) | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- uses: pierreraffa/[email protected] | ||
|
||
pre_run: | ||
name: Provide additional context for the workflow | ||
runs-on: ubuntu-latest | ||
|
@@ -42,24 +56,10 @@ jobs: | |
shared_builder: ${{ steps.matrix.outputs.shared }} | ||
|
||
steps: | ||
- id: run_cond | ||
uses: fkirc/[email protected] | ||
with: | ||
# Cancel CI on outdated commits | ||
cancel_others: true | ||
# Don't skip when a duplicated run (ie. from a PR) is done. | ||
# | ||
# Only CI in upstream has docs publishing rights. | ||
skip_after_successful_duplicate: false | ||
# Do not skip on push, dispatched or cron | ||
do_not_skip: '["push", "workflow_dispatch", "schedule"]' | ||
|
||
- id: skip_result | ||
name: Whether to skip checks | ||
run: | | ||
if [[ '${{ steps.run_cond.outputs.should_skip }}' == true ]]; then | ||
echo "result=true" >> $GITHUB_OUTPUT | ||
elif [[ '${{ github.event.pull_request.draft }}' == true ]]; then | ||
if [[ '${{ github.event.pull_request.draft }}' == true ]]; then | ||
echo "Pull request is in draft state, skipping" | ||
echo "result=true" >> $GITHUB_OUTPUT | ||
else | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,17 @@ on: | |
merge_group: | ||
|
||
jobs: | ||
cancel: | ||
if: github.event == 'merge_group' | ||
name: Cancel previous runs (Merge Queue) | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- uses: pierreraffa/[email protected] | ||
|
||
leaktest: | ||
# Skip this for PRs | ||
if: github.event_name != 'pull_request' | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,14 @@ on: | |
branches: | ||
- devel | ||
|
||
workflow_call: | ||
inputs: | ||
run_id: | ||
required: false | ||
type: string | ||
description: The run ID with artifacts to be published | ||
default: ${{ github.run_id }} | ||
|
||
# Run every script actions in bash | ||
defaults: | ||
run: | ||
|
@@ -28,13 +36,20 @@ jobs: | |
- name: Obtain latest successful run id | ||
id: finder | ||
run: | | ||
run_id=$(gh run list \ | ||
-c "$COMMIT" \ | ||
-w "$WORKFLOW" \ | ||
-s "$CONCLUSION" \ | ||
--limit 1 \ | ||
--json databaseId \ | ||
--jq '.[].databaseId') | ||
run_id= | ||
if [[ -n $INPUT_RUNID ]]; then | ||
echo "Using input run id" | ||
run_id=$INPUT_RUNID | ||
else | ||
echo "Querying latest run id for $COMMIT" | ||
run_id=$(gh run list \ | ||
-c "$COMMIT" \ | ||
-w "$WORKFLOW" \ | ||
-s "$CONCLUSION" \ | ||
--limit 1 \ | ||
--json databaseId \ | ||
--jq '.[].databaseId') | ||
fi | ||
if [[ -z $run_id ]]; then | ||
echo "::error::Could not find any CI run for commit $COMMIT" | ||
exit 1 | ||
|
@@ -46,6 +61,7 @@ jobs: | |
CONCLUSION: success | ||
GH_TOKEN: ${{ github.token }} | ||
GH_REPO: ${{ github.repository }} | ||
INPUT_RUNID: ${{ inputs.run_id }} | ||
|
||
# Download the latest instance of artifacts from a build done previously | ||
- name: Download generated source archive | ||
|
@@ -91,14 +107,22 @@ jobs: | |
$toUpload | ||
$delimiter | ||
EOF | ||
echo "version=$(./release_manifest version)" >> $GITHUB_OUTPUT | ||
version=$(./release_manifest version) | ||
prerelease=true | ||
[[ $version == *-* ]] || prerelease=false | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
echo "prerelease=$prerelease" >> $GITHUB_OUTPUT | ||
working-directory: release-staging | ||
|
||
- id: release-desc | ||
name: Create release description | ||
run: | | ||
- id: release | ||
name: Create pre-release | ||
uses: softprops/[email protected] | ||
with: | ||
prerelease: true | ||
prerelease: ${{ steps.release-files.outputs.prerelease }} | ||
files: ${{ steps.release-files.outputs.result }} | ||
tag_name: ${{ steps.release-files.outputs.version }} | ||
fail_on_unmatched_files: true | ||
|
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 |
---|---|---|
|
@@ -12,6 +12,17 @@ on: | |
merge_group: | ||
|
||
jobs: | ||
cancel: | ||
if: github.event == 'merge_group' | ||
name: Cancel previous runs (Merge Queue) | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- uses: pierreraffa/[email protected] | ||
|
||
reprotest: | ||
# This job is meant for testing whether the compiler can be built | ||
# reproducibly given the same build environment. | ||
|