Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/actions/use-nodes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,26 @@ runs:
steps:
- name: Install dependencies
shell: bash
run: sudo apt-get update && sudo apt-get install -y curl gcc make clang cmake
run: |
set -euo pipefail

apt_get() {
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 "$@"
}

attempts=3
for attempt in $(seq "$attempts"); do
if apt_get -o APT::Update::Error-Mode=any update && apt_get install -y curl gcc make clang cmake; then
exit 0
fi

if [ "$attempt" -lt "$attempts" ]; then
sleep $((attempt * 10))
fi
done

echo "::error::apt-get update/install failed after $attempts attempts"
exit 1

- name: Download substrate-node binary
id: download-substrate-binary
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/build-nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,26 @@ jobs:
repository: paritytech/polkadot-sdk

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler curl gcc make clang cmake llvm-dev libclang-dev
run: |
set -euo pipefail

apt_get() {
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 "$@"
}

attempts=3
for attempt in $(seq "$attempts"); do
if apt_get -o APT::Update::Error-Mode=any update && apt_get install -y protobuf-compiler curl gcc make clang cmake llvm-dev libclang-dev; then
exit 0
fi

if [ "$attempt" -lt "$attempts" ]; then
sleep $((attempt * 10))
fi
done

echo "::error::apt-get update/install failed after $attempts attempts"
exit 1

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
Expand Down
Loading