Skip to content

Commit

Permalink
Merge branch 'rc-2024.08.2' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jacderida committed Aug 27, 2024
2 parents 6fb9e27 + 87a06ff commit 629a16f
Show file tree
Hide file tree
Showing 119 changed files with 5,095 additions and 2,322 deletions.
145 changes: 74 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 @@ -77,6 +77,9 @@ jobs:
shell: bash
run: if [[ ! $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].features.default[]? | select(. == "local-discovery")') ]]; then echo "local-discovery is not a default feature in any package."; else echo "local-discovery is a default feature in at least one package." && exit 1; fi

- name: Clean out the target directory
run: cargo clean

# In a cargo workspace, feature unification can occur, allowing a crate to be built successfully even if it
# doesn't explicitly specify a feature it uses, provided another crate in the workspace enables that feature.
# To detect such cases, we must build each crate using `--package` flag, building all packages at once does not work.
Expand All @@ -95,7 +98,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 +345,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 +418,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
27 changes: 19 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
# also be updated.
env:
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 }}
NETWORK_ROYALTIES_PK: ${{ secrets.STABLE_NETWORK_ROYALTIES_PK }}
PAYMENT_FORWARD_PK: ${{ secrets.STABLE_REWARD_FORWARDING_PK }}

jobs:
build:
Expand All @@ -22,6 +17,13 @@ jobs:
(github.ref == 'refs/heads/stable' || startsWith(github.ref, 'refs/heads/rc'))
}}
name: build
environment: ${{ github.ref == 'refs/heads/stable' && 'stable' || 'release-candidate' }}
env:
FOUNDATION_PK: ${{ vars.FOUNDATION_PK }}
GENESIS_PK: ${{ vars.GENESIS_PK }}
GENESIS_SK: ${{ secrets.GENESIS_SK }}
NETWORK_ROYALTIES_PK: ${{ vars.NETWORK_ROYALTIES_PK }}
PAYMENT_FORWARD_PK: ${{ vars.PAYMENT_FORWARD_PK }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -139,7 +141,6 @@ jobs:
name: github release
runs-on: ubuntu-latest
needs: [ build ]

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
Expand Down Expand Up @@ -176,6 +177,16 @@ jobs:
shell: bash
run: cargo binstall --no-confirm just

- name: set stable release prefix
if: ${{ github.ref == 'refs/heads/stable' }}
run: |
echo "RELEASE_PREFIX=stable" >> $GITHUB_ENV
- name: set rc release prefix
if: ${{ startsWith(github.ref, 'refs/heads/rc') }}
run: |
echo "RELEASE_PREFIX=rc" >> $GITHUB_ENV
- name: set package version
shell: bash
run: |
Expand All @@ -196,7 +207,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.VERSION_BUMP_COMMIT_PAT }}
with:
tag_name: ${{ env.PACKAGE_VERSION }}
tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.PACKAGE_VERSION }}
release_name: ${{ env.PACKAGE_VERSION }}
draft: false
prerelease: ${{ startsWith(github.ref, 'refs/heads/rc') && true || false }}
Expand All @@ -208,7 +219,7 @@ jobs:
run: |
(
cd packaged_architectures
ls | xargs gh release upload ${{ env.PACKAGE_VERSION }}
ls | xargs gh release upload ${{ env.RELEASE_PREFIX }}-${{ env.PACKAGE_VERSION }}
)
- name: post notification to slack on failure
Expand Down
Loading

0 comments on commit 629a16f

Please sign in to comment.