-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A0-4268: chain-bootstrapper CI (#1720)
# Description This PR contains changes required for feature nets to work from `main` again. It also adds proper CI support for `chain-bootstrapper`. Workflows that build `aleph-node` were merged into one to avoid code duplication. The `key` subcommand was added to `chain-bootstrapper`—it does not increase compilation time and is used by the FE engine to bootstrap the chain. Also, there's better coupling between workflows as they output GH Artifact names that other workflows consume. ## Type of change Please delete options that are not relevant. - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## Testing Update net tests are omitted since they needs to be fixed on `main` anyway. 1. [FE create from `main`](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/9090690639/job/24983952063) - OK 2. [FE created from Mainnet](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/9091207050/job/24985384641) - OK 3. [On push to main workflow test](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/9091734325) - OK 4. [Nightly pipeline normal session e2e tests](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/9092279244) - OK 5. [Nightly pipeline e2e tests on featurenet](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/9092281415) - OK ## Actions before merge PR Replace all `A0-4268` and `v6` to `v7` ## Companion PRs Cardinal-Cryptography/featurenet-template#30 Cardinal-Cryptography/github-actions#49
- Loading branch information
1 parent
6bd8d35
commit fbdf102
Showing
46 changed files
with
556 additions
and
360 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
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
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
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
# This workflow builds aleph-node binary. It outputs name of artifacts uploaded to GH Artifacts. | ||
name: Build aleph-node | ||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: 'git ref: hash, branch, tag to build aleph-node binary from' | ||
type: string | ||
required: true | ||
production: | ||
description: 'Set to true to build production binary, otherwise set to false' | ||
type: boolean | ||
required: true | ||
outputs: | ||
artifact-name-binary: | ||
description: 'Name of artifact aleph-node binary' | ||
value: ${{ jobs.main.outputs.artifact-name-binary }} | ||
artifact-name-image: | ||
description: 'Name of artifact aleph-node image' | ||
value: ${{ jobs.main.outputs.artifact-name-image }} | ||
jobs: | ||
main: | ||
name: Build aleph-node (production=${{ inputs.production }}) | ||
runs-on: [self-hosted, Linux, X64, large] | ||
env: | ||
RUST_BACKTRACE: full | ||
RUSTC_WRAPPER: sccache | ||
CARGO_FOLDER: ${{ inputs.production == true && 'production' || 'release' }} | ||
ARTIFACT_NAME_SUFFIX: ${{ inputs.production == true && 'production' || 'test' }} | ||
outputs: | ||
artifact-name-binary: ${{ steps.get-artifact-name-binary.outputs.name }} | ||
artifact-name-image: ${{ steps.get-artifact-name-image.outputs.name }} | ||
steps: | ||
- name: Checkout aleph-node source code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Call action get-ref-properties | ||
id: get-ref-properties | ||
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 | ||
|
||
- name: Install Rust toolchain | ||
uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v7 | ||
|
||
- name: Build test aleph-node | ||
if: ${{ inputs.production != true }} | ||
run: | | ||
cargo build --release -p aleph-node --features only_legacy | ||
- name: Build production aleph-node | ||
if: ${{ inputs.production == true }} | ||
run: cargo build --profile production -p aleph-node | ||
|
||
- name: Get binary artifact name | ||
id: get-artifact-name-binary | ||
run: | | ||
echo "name=aleph-node-${{ env.ARTIFACT_NAME_SUFFIX }}" >> $GITHUB_OUTPUT | ||
- name: Upload binary to GH Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.get-artifact-name-binary.outputs.name }} | ||
path: target/${{ env.CARGO_FOLDER }}/aleph-node | ||
if-no-files-found: error | ||
retention-days: 7 | ||
|
||
- name: Build aleph-node docker image | ||
run: | | ||
chmod +x target/${{ env.CARGO_FOLDER }}/aleph-node | ||
if [[ ${{ inputs.production }} == true ]]; then | ||
mkdir -p target/release | ||
mv target/production/aleph-node target/release/ | ||
fi | ||
docker build --tag aleph-node:latest -f ./docker/Dockerfile . | ||
docker save -o aleph-node.tar aleph-node:latest | ||
- name: Get image artifact name | ||
id: get-artifact-name-image | ||
run: | | ||
echo "name=aleph-node-image-${{ env.ARTIFACT_NAME_SUFFIX }}" >> $GITHUB_OUTPUT | ||
- name: Upload docker to GH Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.get-artifact-name-image.outputs.name }} | ||
path: aleph-node.tar | ||
if-no-files-found: error | ||
retention-days: 7 |
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
76 changes: 0 additions & 76 deletions
76
.github/workflows/_build-and-push-featurenet-node-image.yml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.