Skip to content

Commit

Permalink
Merge branch 'main' into refactor-deps-lazy-static
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee authored Jul 26, 2024
2 parents 5a8ae48 + bc37597 commit 9e2c533
Show file tree
Hide file tree
Showing 50 changed files with 1,621 additions and 1,088 deletions.
50 changes: 27 additions & 23 deletions .github/workflows/build-release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
name: build release artifacts
# This workflow builds and packages the release artifacts, without actually running a release.
#
# It can sometimes be useful to obtain these binaries built from other branches, or a tag, or when
# the release process is being updated, this workflow can be used to test some of the changes.
#
# The built and packaged binaries will be attached to the workflow run as artifacts, available for
# download.
name: build and package release artifacts

on:
workflow_dispatch:
inputs:
branch:
description: The branch to build.
description: Set to build a particular branch
type: string
tag:
description: The tag to build.
description: Set to build a particular tag
type: string

# Copied from `release.yml`
# During the build step, the env variable has to be manually sent to the containers for cross platform builds.
# Update the Justfile as well.
# The key variables also need to be passed to `cross`, which runs in a container and does not
# inherit variables from the parent environment. The `cross` tool is used in the `build`
# job. If any keys are added, the `build-release-artifacts` target in the Justfile must
# also be updated.
env:
JUST_BIN_URL: https://github.com/casey/just/releases/download/1.25.2/just-1.25.2-x86_64-unknown-linux-musl.tar.gz
WORKFLOW_URL: https://github.com/maidsafe/safe_network/actions/runs
GENESIS_PK: ${{ secrets.STABLE_GENESIS_PK }}
GENESIS_SK: ${{ secrets.STABLE_GENESIS_SK }}
FOUNDATION_PK: ${{ secrets.STABLE_FOUNDATION_PK }}
Expand Down Expand Up @@ -48,8 +54,6 @@ jobs:
with:
ref: ${{ inputs.tag || inputs.branch }}
- uses: dtolnay/rust-toolchain@stable
# cargo-binstall will try and use pre-built binaries if they are available and also speeds up
# installing `cross`
- uses: cargo-bins/cargo-binstall@main
- shell: bash
run: cargo binstall --no-confirm just
Expand All @@ -63,8 +67,6 @@ jobs:
artifacts
!artifacts/.cargo-lock
# This job isn't necessary, but it's useful for debugging the packaging process for the real release
# workflow, just in case any issues are ever encountered there.
package:
name: package artifacts
runs-on: ubuntu-latest
Expand Down Expand Up @@ -104,19 +106,21 @@ jobs:
- uses: cargo-bins/cargo-binstall@main
- shell: bash
run: cargo binstall --no-confirm just
- name: package artifacts

- name: package binaries
shell: bash
run: |
just package-release-assets "faucet"
just package-release-assets "nat-detection"
just package-release-assets "node-launchpad"
just package-release-assets "safe"
just package-release-assets "safenode"
just package-release-assets "safenode_rpc_client"
just package-release-assets "safenode-manager"
just package-release-assets "safenodemand"
just package-release-assets "sn_auditor"
just package-all-bins
- uses: actions/upload-artifact@main
with:
name: packaged_binaries
path: deploy
path: packaged_bins

- name: package architectures
shell: bash
run: |
just package-all-architectures
- uses: actions/upload-artifact@main
with:
name: packaged_architectures
path: packaged_architectures
142 changes: 71 additions & 71 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
# on main, we want to know that all commits are passing at a glance, any deviation should help bisecting errors
# the merge run checks should show on master and enable this clear test/passing history
merge_group:
branches: [ main, alpha*, beta*, rc* ]
branches: [main, alpha*, beta*, rc*]
pull_request:
branches: [ "*" ]
branches: ["*"]

env:
CARGO_INCREMENTAL: 0 # bookkeeping for incremental builds has overhead, not useful in CI.
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -415,80 +415,80 @@ jobs:
log_file_prefix: safe_test_logs_spend
platform: ${{ matrix.os }}

# runs with increased node count
spend_simulation:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: spend simulation
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Build binaries
run: cargo build --release --features=local-discovery --bin safenode
timeout-minutes: 30

- name: Build faucet binary
run: cargo build --release --bin faucet --features="local-discovery,gifting"
timeout-minutes: 30

- name: Build testing executable
run: cargo test --release -p sn_node --features=local-discovery --test spend_simulation --no-run
env:
# only set the target dir for windows to bypass the linker issue.
# happens if we build the node manager via testnet action
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/sn-local-testnet-action@main
with:
action: start
interval: 2000
node-count: 50
node-path: target/release/safenode
faucet-path: target/release/faucet
platform: ${{ matrix.os }}
build: true

- name: Check SAFE_PEERS was set
shell: bash
run: |
if [[ -z "$SAFE_PEERS" ]]; then
echo "The SAFE_PEERS variable has not been set"
exit 1
else
echo "SAFE_PEERS has been set to $SAFE_PEERS"
fi
- name: execute the spend simulation
run: cargo test --release -p sn_node --features="local-discovery" --test spend_simulation -- --nocapture
env:
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 25

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/sn-local-testnet-action@main
with:
action: stop
log_file_prefix: safe_test_logs_spend_simulation
platform: ${{ matrix.os }}
# # runs with increased node count
# spend_simulation:
# if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
# name: spend simulation
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ ubuntu-latest, windows-latest, macos-latest ]
# steps:
# - uses: actions/checkout@v4

# - name: Install Rust
# uses: dtolnay/rust-toolchain@stable

# - uses: Swatinem/rust-cache@v2

# - name: Build binaries
# run: cargo build --release --features=local-discovery --bin safenode
# timeout-minutes: 30

# - name: Build faucet binary
# run: cargo build --release --bin faucet --features="local-discovery,gifting"
# timeout-minutes: 30

# - name: Build testing executable
# run: cargo test --release -p sn_node --features=local-discovery --test spend_simulation --no-run
# env:
# # only set the target dir for windows to bypass the linker issue.
# # happens if we build the node manager via testnet action
# CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
# timeout-minutes: 30

# - name: Start a local network
# uses: maidsafe/sn-local-testnet-action@main
# with:
# action: start
# interval: 2000
# node-count: 50
# node-path: target/release/safenode
# faucet-path: target/release/faucet
# platform: ${{ matrix.os }}
# build: true

# - name: Check SAFE_PEERS was set
# shell: bash
# run: |
# if [[ -z "$SAFE_PEERS" ]]; then
# echo "The SAFE_PEERS variable has not been set"
# exit 1
# else
# echo "SAFE_PEERS has been set to $SAFE_PEERS"
# fi

# - name: execute the spend simulation
# run: cargo test --release -p sn_node --features="local-discovery" --test spend_simulation -- --nocapture
# env:
# CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
# timeout-minutes: 25

# - name: Stop the local network and upload logs
# if: always()
# uses: maidsafe/sn-local-testnet-action@main
# with:
# action: stop
# log_file_prefix: safe_test_logs_spend_simulation
# platform: ${{ matrix.os }}

token_distribution_test:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: token distribution test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

Expand Down
Loading

0 comments on commit 9e2c533

Please sign in to comment.