forked from ethstorage/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
CI updates for v1.16.8 merge #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
syntrust
wants to merge
11
commits into
op-es
Choose a base branch
from
op-es-ci-v1.16.8
base: op-es
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
78d9724
CI updates for v1.16.8 merge
syntrust 9e84227
debug
syntrust b4926a5
debug
syntrust c3e70f3
debug
syntrust 221760f
rm useless
syntrust 682ae49
rm superviser related as removed by upstream
syntrust abc10a9
fix missing binary
syntrust ca36f75
add missing go tests
syntrust 5b47147
cleanup
syntrust 0a30235
fix comments
syntrust 24b0111
more comments
syntrust File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,120 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| #MISE description="One-time setup for local dev-test dependencies" | ||
| #MISE alias="dt-setup" | ||
|
|
||
| set -e | ||
| set -E -o pipefail | ||
|
|
||
| halt() { | ||
| echo "Error: $*" >&2 | ||
| return 1 2>/dev/null || exit 1 | ||
| } | ||
|
|
||
| run_step() { | ||
| local label="$1" | ||
| shift | ||
| echo "==========Starting ${label}..." | ||
| "$@" | ||
| echo "===================${label} done." | ||
| } | ||
|
|
||
| require_command() { | ||
| local cmd="$1" | ||
| local help_msg="$2" | ||
| if ! command -v "$cmd" >/dev/null 2>&1; then | ||
| halt "Missing required command: $cmd. ${help_msg}" | ||
| fi | ||
| } | ||
|
|
||
| install_system_package() { | ||
| local pkg="$1" | ||
| local install_hint="" | ||
|
|
||
| case "$pkg" in | ||
| docker) install_hint="docker.io (or docker)" ;; | ||
| *) install_hint="$pkg" ;; | ||
| esac | ||
|
|
||
| case "$(uname -s)" in | ||
| Darwin) | ||
| require_command brew "Homebrew is required to install ${install_hint} on macOS." | ||
| if [ "$pkg" = "docker" ]; then | ||
| brew install --cask docker | ||
| else | ||
| brew install "$pkg" | ||
| fi | ||
| ;; | ||
| Linux) | ||
| local SUDO="" | ||
| if [ "${EUID:-$(id -u)}" -ne 0 ]; then | ||
| if command -v sudo >/dev/null 2>&1; then | ||
| SUDO="sudo -E" | ||
| else | ||
| halt "Need to install '${install_hint}' but current user is not root and 'sudo' is unavailable. Please install it manually." | ||
| fi | ||
| fi | ||
|
|
||
| if command -v apt-get >/dev/null 2>&1; then | ||
| ${SUDO} apt-get update | ||
| if [ "$pkg" = "docker" ]; then | ||
| ${SUDO} apt-get install -y docker.io | ||
| else | ||
| ${SUDO} apt-get install -y "$pkg" | ||
| fi | ||
| elif command -v dnf >/dev/null 2>&1; then | ||
| if [ "$pkg" = "docker" ]; then | ||
| ${SUDO} dnf install -y docker | ||
| else | ||
| ${SUDO} dnf install -y "$pkg" | ||
| fi | ||
| elif command -v apk >/dev/null 2>&1; then | ||
| if [ "$pkg" = "docker" ]; then | ||
| ${SUDO} apk add --no-cache docker | ||
| else | ||
| ${SUDO} apk add --no-cache "$pkg" | ||
| fi | ||
| else | ||
| halt "No supported package manager found to install $pkg." | ||
| fi | ||
| ;; | ||
| *) | ||
| halt "Unsupported OS for automatic installation: $(uname -s)" | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| require_clang_c_headers() { | ||
| local probe='#include <stdarg.h> | ||
| #include <stdbool.h> | ||
| int main(void){return 0;}' | ||
|
|
||
| if ! printf "%s\n" "$probe" | clang -x c - -fsyntax-only >/dev/null 2>&1; then | ||
| halt "Missing C toolchain headers for clang (stdarg.h/stdbool.h). Install system deps manually (Ubuntu/Debian: build-essential clang libc6-dev libclang-dev)." | ||
| fi | ||
| } | ||
|
|
||
| echo "==========Preparing local dev-test environment..." | ||
| require_command mise "Install mise first so this setup script can provision repo-managed tools." | ||
|
|
||
| run_step "mise install" mise install | ||
|
|
||
| if [ -z "${MISE_SHELL:-}" ]; then | ||
| if [ -n "${ZSH_VERSION:-}" ]; then | ||
| eval "$(mise activate zsh)" | ||
| elif [ -n "${BASH_VERSION:-}" ]; then | ||
| eval "$(mise activate bash)" | ||
| fi | ||
| fi | ||
|
|
||
| command -v m4 >/dev/null 2>&1 || install_system_package m4 | ||
| command -v clang >/dev/null 2>&1 || install_system_package clang | ||
| command -v docker >/dev/null 2>&1 || install_system_package docker | ||
| require_clang_c_headers | ||
|
|
||
| command -v cargo-binstall >/dev/null 2>&1 || cargo install cargo-binstall --locked | ||
| command -v cargo-nextest >/dev/null 2>&1 || cargo binstall --no-confirm cargo-nextest | ||
| cargo nextest --version >/dev/null 2>&1 || halt "Failed to install cargo-nextest." | ||
|
|
||
| echo "==========dev-test setup complete." | ||
| echo "Now run: mise run dt" |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case can pass when running on its own.