3bd2fa71eb
Bumps the ci_dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [benchmark-action/github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) | `1.20.7` | `1.21.0` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `6.19.2` | `7.0.0` | | [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.0.0` | | [actions/setup-node](https://github.com/actions/setup-node) | `6.2.0` | `6.3.0` | | [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `47.0.4` | `47.0.5` | Updates `benchmark-action/github-action-benchmark` from 1.20.7 to 1.21.0 - [Release notes](https://github.com/benchmark-action/github-action-benchmark/releases) - [Changelog](https://github.com/benchmark-action/github-action-benchmark/blob/master/CHANGELOG.md) - [Commits](https://github.com/benchmark-action/github-action-benchmark/compare/4bdcce38c94cec68da58d012ac24b7b1155efe8b...a7bc2366eda11037936ea57d811a43b3418d3073) Updates `docker/build-push-action` from 6.19.2 to 7.0.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/10e90e3645eae34f1e60eeb005ba3a3d33f178e8...d08e5c354a6adb9ed34480a06d141179aa583294) Updates `docker/login-action` from 3.7.0 to 4.0.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/c94ce9fb468520275223c153574b00df6fe4bcc9...b45d80f862d83dbcd57f89517bcf500b2ab88fb2) Updates `actions/setup-node` from 6.2.0 to 6.3.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/6044e13b5dc448c55e2357c09f80417699197238...53b83947a5a98c8d113130e565377fae1a50d02f) Updates `tj-actions/changed-files` from 47.0.4 to 47.0.5 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/7dee1b0c1557f278e5c7dc244927139d78c0e22a...22103cc46bda19c2b464ffe86db46df6922fd323) --- updated-dependencies: - dependency-name: benchmark-action/github-action-benchmark dependency-version: 1.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ci_dependencies - dependency-name: docker/build-push-action dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci_dependencies - dependency-name: docker/login-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci_dependencies - dependency-name: actions/setup-node dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ci_dependencies - dependency-name: tj-actions/changed-files dependency-version: 47.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ci_dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
228 lines
8.7 KiB
YAML
228 lines
8.7 KiB
YAML
# Reusable workflow to set various useful variables
|
|
# and to perform checks and generate conditions for other workflows.
|
|
# Currently it checks if any Rust (build-related) file is changed
|
|
# and if the current (caller) workflow file is changed.
|
|
# Example:
|
|
#
|
|
# jobs:
|
|
# preflight:
|
|
# uses: ./.github/workflows/reusable-preflight.yml
|
|
# some-job:
|
|
# needs: changes
|
|
# if: ${{ needs.preflight.outputs.changes_rust }}
|
|
# .......
|
|
|
|
name: Preflight
|
|
|
|
on:
|
|
workflow_call:
|
|
# Map the workflow outputs to job outputs
|
|
outputs:
|
|
changes_rust:
|
|
value: ${{ jobs.preflight.outputs.changes_rust }}
|
|
changes_currentWorkflow:
|
|
value: ${{ jobs.preflight.outputs.changes_currentWorkflow }}
|
|
|
|
IMAGE:
|
|
value: ${{ jobs.preflight.outputs.IMAGE }}
|
|
description: "CI image"
|
|
|
|
# Runners
|
|
# https://github.com/pezkuwichain/ci_cd/wiki/GitHub#pezkuwichain-self-hosted-runners
|
|
RUNNER:
|
|
value: ${{ jobs.preflight.outputs.RUNNER }}
|
|
description: |
|
|
Main runner for resource-intensive tasks
|
|
By default we use spot machines that can be terminated at any time.
|
|
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
|
RUNNER_OLDLINUX:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_OLDLINUX }}
|
|
description: |
|
|
pezkuwichain-oldlinux
|
|
By default we use spot machines that can be terminated at any time.
|
|
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
|
# New is used only during transition to the new runners
|
|
RUNNER_NEW:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_NEW }}
|
|
description: |
|
|
Main runner for resource-intensive tasks
|
|
By default we use spot machines that can be terminated at any time.
|
|
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
|
RUNNER_OLDLINUX_NEW:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_OLDLINUX_NEW }}
|
|
description: |
|
|
pezkuwichain-oldlinux
|
|
By default we use spot machines that can be terminated at any time.
|
|
Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
|
RUNNER_DEFAULT:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_DEFAULT }}
|
|
description: "Relatively lightweight runner. When `ubuntu-latest` is not enough"
|
|
RUNNER_WEIGHTS:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_WEIGHTS }}
|
|
RUNNER_BENCHMARK:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_BENCHMARK }}
|
|
RUNNER_MACOS:
|
|
value: ${{ jobs.preflight.outputs.RUNNER_MACOS }}
|
|
|
|
# Vars
|
|
SOURCE_REF_SLUG:
|
|
value: ${{ jobs.preflight.outputs.SOURCE_REF_SLUG }}
|
|
description: "Name of the current branch for `push` or source branch for `pull_request` with `/` replaced by `_`. Does not exists in merge_group"
|
|
REF_SLUG:
|
|
value: ${{ jobs.preflight.outputs.REF_SLUG }}
|
|
description: |
|
|
Name of the current revision (depending on the event) with `/` replaced by `_`, e.g:
|
|
push - main
|
|
pull_request - 49_merge
|
|
merge_group - gh-readonly-queue_master_pr-49-38d43798a986430231c828b2c762997f818ac012
|
|
|
|
COMMIT_SHA:
|
|
value: ${{ jobs.preflight.outputs.COMMIT_SHA }}
|
|
description: "Sha of the current revision"
|
|
COMMIT_SHA_SHORT:
|
|
value: ${{ jobs.preflight.outputs.COMMIT_SHA_SHORT }}
|
|
description: "Sha of the current revision, 8-symbols long"
|
|
|
|
jobs:
|
|
#
|
|
#
|
|
#
|
|
preflight:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
changes_rust: ${{ steps.set_changes.outputs.rust_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
|
|
changes_currentWorkflow: ${{ steps.set_changes.outputs.currentWorkflow_any_changed }}
|
|
|
|
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
|
|
|
|
# Runners
|
|
# https://github.com/pezkuwichain/ci_cd/wiki/GitHub#pezkuwichain-self-hosted-runners
|
|
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
|
|
RUNNER_NEW: ${{ steps.set_runner.outputs.RUNNER_NEW }}
|
|
RUNNER_OLDLINUX: ${{ steps.set_runner.outputs.RUNNER_OLDLINUX }}
|
|
RUNNER_OLDLINUX_NEW: ${{ steps.set_runner.outputs.RUNNER_OLDLINUX_NEW }}
|
|
RUNNER_DEFAULT: ${{ steps.set_runner.outputs.RUNNER_DEFAULT }}
|
|
RUNNER_WEIGHTS: ${{ steps.set_runner.outputs.RUNNER_WEIGHTS }}
|
|
RUNNER_BENCHMARK: ${{ steps.set_runner.outputs.RUNNER_BENCHMARK }}
|
|
RUNNER_MACOS: ${{ steps.set_runner.outputs.RUNNER_MACOS }}
|
|
|
|
SOURCE_REF_SLUG: ${{ steps.set_vars.outputs.SOURCE_REF_SLUG }}
|
|
REF_SLUG: ${{ steps.set_vars.outputs.REF_SLUG }}
|
|
|
|
COMMIT_SHA: ${{ steps.set_vars.outputs.COMMIT_SHA }}
|
|
COMMIT_SHA_SHORT: ${{ steps.set_vars.outputs.COMMIT_SHA_SHORT }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
#
|
|
# Set changes
|
|
#
|
|
- name: Current file
|
|
id: current_file
|
|
shell: bash
|
|
run: |
|
|
echo "currentWorkflowFile=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
|
|
echo "currentActionDir=$(echo ${{ github.action_path }} | sed -nE "s/.*(\.github\/actions\/[a-zA-Z0-9_-]*)/\1/p")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set changes
|
|
id: set_changes
|
|
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 #v47.0.5
|
|
with:
|
|
files_yaml: |
|
|
rust:
|
|
- '**/*'
|
|
- '!.github/**/*'
|
|
- '!prdoc/**/*'
|
|
- '!docs/**/*'
|
|
currentWorkflow:
|
|
- '${{ steps.current_file.outputs.currentWorkflowFile }}'
|
|
- '.github/workflows/reusable-preflight.yml'
|
|
|
|
#
|
|
# Set image
|
|
#
|
|
- name: Set image
|
|
id: set_image
|
|
shell: bash
|
|
run: cat .github/env >> $GITHUB_OUTPUT
|
|
|
|
#
|
|
# Set runner
|
|
#
|
|
# By default we use spot machines that can be terminated at any time.
|
|
# Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
|
|
#
|
|
- name: Set runner
|
|
id: set_runner
|
|
shell: bash
|
|
run: |
|
|
# Hybrid: heavy jobs → self-hosted ephemeral VPS, light jobs → GitHub-hosted
|
|
echo "RUNNER_DEFAULT=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
echo "RUNNER_WEIGHTS=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
echo "RUNNER_BENCHMARK=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
echo "RUNNER_MACOS=macos-latest" >> $GITHUB_OUTPUT
|
|
echo "RUNNER=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
echo "RUNNER_OLDLINUX=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
echo "RUNNER_NEW=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
echo "RUNNER_OLDLINUX_NEW=pezkuwi-runner" >> $GITHUB_OUTPUT
|
|
|
|
#
|
|
# Set vars
|
|
#
|
|
- name: Set vars
|
|
id: set_vars
|
|
shell: bash
|
|
run: |
|
|
export SOURCE_REF_NAME=${{ github.head_ref || github.ref_name }}
|
|
echo "SOURCE_REF_SLUG=${SOURCE_REF_NAME//\//_}" >> $GITHUB_OUTPUT
|
|
#
|
|
export COMMIT_SHA=${{ github.sha }}
|
|
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_OUTPUT
|
|
echo "COMMIT_SHA_SHORT=${COMMIT_SHA:0:8}" >> $GITHUB_OUTPUT
|
|
#
|
|
export REF_NAME=${{ github.ref_name }}
|
|
echo "REF_SLUG=${REF_NAME//\//_}" >> $GITHUB_OUTPUT
|
|
|
|
- name: log
|
|
shell: bash
|
|
run: |
|
|
echo "workflow file: ${{ steps.current_file.outputs.currentWorkflowFile }}"
|
|
echo "Modified: ${{ steps.set_changes.outputs.modified_keys }}"
|
|
|
|
#
|
|
#
|
|
#
|
|
ci-versions:
|
|
needs: [preflight]
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ${{ needs.preflight.outputs.IMAGE }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Info rust
|
|
run: |
|
|
rustup show
|
|
cargo --version
|
|
cargo +nightly --version
|
|
cargo clippy --version
|
|
echo "yarn version: $(yarn --version)"
|
|
echo $( bizinikiwi-contracts-node --version | awk 'NF' )
|
|
estuary --version
|
|
cargo-contract --version
|
|
taplo --version
|
|
|
|
- name: Info vars
|
|
run: |
|
|
echo "COMMIT_SHA: ${{ needs.preflight.outputs.COMMIT_SHA }}"
|
|
echo "COMMIT_SHA_SHORT: ${{ needs.preflight.outputs.COMMIT_SHA_SHORT }}"
|
|
echo "SOURCE_REF_SLUG: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}"
|
|
echo "REF_SLUG: ${{ needs.preflight.outputs.REF_SLUG }}"
|
|
echo "RUNNER: ${{ needs.preflight.outputs.RUNNER }}"
|
|
echo "IMAGE: ${{ needs.preflight.outputs.IMAGE }}"
|
|
#
|
|
echo "github.ref: ${{ github.ref }}"
|
|
echo "github.ref_name: ${{ github.ref_name }}"
|
|
echo "github.sha: ${{ github.sha }}"
|