mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-04 06:13:09 +00:00
Align CI binaries cache keys with VERSION
This commit is contained in:
parent
68027080b8
commit
5c1ddf4ad9
14
.github/workflows/lint.yml
vendored
14
.github/workflows/lint.yml
vendored
@ -213,14 +213,14 @@ jobs:
|
|||||||
id: restore-nomos-bins-host
|
id: restore-nomos-bins-host
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/.tmp/nomos-binaries-host-${{ env.VERSION }}.tar.gz
|
path: ${{ github.workspace }}/.tmp/nomos-binaries.tar.gz
|
||||||
key: ${{ runner.os }}-nomos-binaries-host-${{ env.VERSION }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
key: ${{ runner.os }}-nomos-binaries-${{ env.VERSION }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
||||||
|
|
||||||
- name: Download nomos binaries artifact (fallback)
|
- name: Download nomos binaries artifact (fallback)
|
||||||
if: steps.restore-nomos-bins-host.outputs.cache-hit != 'true'
|
if: steps.restore-nomos-bins-host.outputs.cache-hit != 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
ARTIFACT_NAME: nomos-binaries-host-${{ env.VERSION }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
ARTIFACT_NAME: nomos-binaries-${{ runner.os }}-${{ env.VERSION }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p "${TMPDIR}"
|
mkdir -p "${TMPDIR}"
|
||||||
@ -239,12 +239,12 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkdir -p "${GITHUB_WORKSPACE}/.tmp"
|
mkdir -p "${GITHUB_WORKSPACE}/.tmp"
|
||||||
mv "$found_tar" "${GITHUB_WORKSPACE}/.tmp/nomos-binaries-host-${VERSION}.tar.gz"
|
mv "$found_tar" "${GITHUB_WORKSPACE}/.tmp/nomos-binaries.tar.gz"
|
||||||
- name: Normalize host bundle path
|
- name: Normalize host bundle path
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p .tmp
|
mkdir -p .tmp
|
||||||
SRC="${GITHUB_WORKSPACE}/.tmp/nomos-binaries-host-${VERSION}.tar.gz"
|
SRC="${GITHUB_WORKSPACE}/.tmp/nomos-binaries.tar.gz"
|
||||||
DEST="${GITHUB_WORKSPACE}/.tmp/nomos-binaries-host-${VERSION}.tar.gz"
|
DEST="${GITHUB_WORKSPACE}/.tmp/nomos-binaries-host-${VERSION}.tar.gz"
|
||||||
if [ -f "${SRC}" ]; then
|
if [ -f "${SRC}" ]; then
|
||||||
mv "${SRC}" "${DEST}"
|
mv "${SRC}" "${DEST}"
|
||||||
@ -313,13 +313,13 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/.tmp/nomos-binaries.tar.gz
|
path: ${{ github.workspace }}/.tmp/nomos-binaries.tar.gz
|
||||||
key: ${{ runner.os }}-nomos-binaries-${{ env.NOMOS_NODE_REV }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
key: ${{ runner.os }}-nomos-binaries-${{ env.VERSION }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
||||||
|
|
||||||
- name: Download nomos binaries artifact (fallback)
|
- name: Download nomos binaries artifact (fallback)
|
||||||
if: steps.restore-nomos-bins.outputs.cache-hit != 'true'
|
if: steps.restore-nomos-bins.outputs.cache-hit != 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
ARTIFACT_NAME: nomos-binaries-${{ runner.os }}-${{ env.NOMOS_NODE_REV }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
ARTIFACT_NAME: nomos-binaries-${{ runner.os }}-${{ env.VERSION }}-${{ env.NOMOS_BUNDLE_VERSION }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
download_dir="${TMPDIR}/nomos-binaries-download"
|
download_dir="${TMPDIR}/nomos-binaries-download"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use std::time::Duration;
|
use std::{env, time::Duration};
|
||||||
|
|
||||||
use nomos_libp2p::{
|
use nomos_libp2p::{
|
||||||
IdentifySettings, KademliaSettings, Multiaddr, NatSettings, ed25519, gossipsub,
|
IdentifySettings, KademliaSettings, Multiaddr, NatSettings, ed25519, gossipsub,
|
||||||
@ -36,6 +36,19 @@ fn default_swarm_config() -> SwarmConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn nat_settings(port: u16) -> NatSettings {
|
||||||
|
if env::var("NOMOS_USE_AUTONAT").is_ok() {
|
||||||
|
return NatSettings::default();
|
||||||
|
}
|
||||||
|
|
||||||
|
let addr: Multiaddr = format!("/ip4/127.0.0.1/udp/{port}/quic-v1")
|
||||||
|
.parse()
|
||||||
|
.expect("failed to build loopback multiaddr");
|
||||||
|
NatSettings::Static {
|
||||||
|
external_address: addr,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn create_network_configs(
|
pub fn create_network_configs(
|
||||||
ids: &[[u8; 32]],
|
ids: &[[u8; 32]],
|
||||||
@ -48,12 +61,14 @@ pub fn create_network_configs(
|
|||||||
let node_key = ed25519::SecretKey::try_from_bytes(&mut node_key_bytes)
|
let node_key = ed25519::SecretKey::try_from_bytes(&mut node_key_bytes)
|
||||||
.expect("Failed to generate secret key from bytes");
|
.expect("Failed to generate secret key from bytes");
|
||||||
|
|
||||||
|
let port = get_available_udp_port().unwrap();
|
||||||
SwarmConfig {
|
SwarmConfig {
|
||||||
node_key,
|
node_key,
|
||||||
port: get_available_udp_port().unwrap(),
|
port,
|
||||||
chain_sync_config: cryptarchia_sync::Config {
|
chain_sync_config: cryptarchia_sync::Config {
|
||||||
peer_response_timeout: Duration::from_secs(60),
|
peer_response_timeout: Duration::from_secs(60),
|
||||||
},
|
},
|
||||||
|
nat_config: nat_settings(port),
|
||||||
..default_swarm_config()
|
..default_swarm_config()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user