diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72ea28ff2..b9553b5b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,7 @@ jobs: if: steps.nim-compiler-cache.outputs.cache-hit != 'true' shell: bash run: | - bash constantine/.github/workflows/install_nim.sh \ + bash constantine/scripts/install_nim.sh \ --nim-channel ${{ matrix.nim_channel }} \ --nim-version ${{ matrix.nim_version }} \ --os ${{ matrix.target.os }} \ @@ -422,19 +422,29 @@ jobs: cd constantine CTT_ASM=0 nimble test_parallel --verbose - # On Windows - # So "test_bindings" uses C and can find GMP - # but nim-gmp cannot find GMP on Windows CI - # Also need to workaround asynctools not being able to create pipes https://github.com/nim-lang/Nim/issues/23118 - # And LTO impossible constraint in the deneb_kzg test (but not MSM for some reason) - # # On mac # Homebrew install is not in default PATH # this can be workaround with LD_LIBRARY_PATH for libraries # but headers would need a # --passC:-I$(brew --prefix)/include (-I/opt/homebrew/include on latest MacOS versions) - - name: Run Constantine in-depth tests (MacOS/Windows - no GMP, with Assembly)= - if: runner.os != 'Linux' && matrix.target.ctt_backend == 'ASM' + - name: Run Constantine in-depth tests (MacOS - no GMP, with Assembly)= + if: runner.os == 'macOS' && matrix.target.ctt_backend == 'ASM' + run: | + cd constantine + nimble test_parallel_no_gmp --verbose + - name: Run Constantine in-depth tests (MacOS - no GMP, no Assembly) + if: runner.os == 'macOS' && matrix.target.ctt_backend == 'NO_ASM' + run: | + cd constantine + CTT_ASM=0 nimble test_parallel_no_gmp --verbose + + # On Windows + # So "test_bindings" uses C and can find GMP + # but nim-gmp cannot find GMP on Windows CI + # Also need to workaround asynctools not being able to create pipes https://github.com/nim-lang/Nim/issues/23118 + # And LTO impossible constraint in the deneb_kzg test (but not MSM for some reason) + - name: Run Constantine in-depth tests (Windows - no GMP, with Assembly)= + if: runner.os == 'Windows' && matrix.target.ctt_backend == 'ASM' shell: msys2 {0} run: | cd constantine @@ -443,8 +453,8 @@ jobs: else nimble test_parallel_no_gmp --verbose fi - - name: Run Constantine in-depth tests (MacOS/Windows - no GMP, no Assembly) - if: runner.os != 'Linux' && matrix.target.ctt_backend == 'NO_ASM' + - name: Run Constantine in-depth tests (Windows - no GMP, no Assembly) + if: runner.os == 'Windows' && matrix.target.ctt_backend == 'NO_ASM' shell: msys2 {0} run: | cd constantine diff --git a/.github/workflows/install_nim.sh b/scripts/install_nim.sh similarity index 88% rename from .github/workflows/install_nim.sh rename to scripts/install_nim.sh index bdfc524c1..3690b3f9a 100644 --- a/.github/workflows/install_nim.sh +++ b/scripts/install_nim.sh @@ -47,6 +47,40 @@ _nightlies_url=https://github.com/nim-lang/nightlies/releases # UI # ------------------------- +print-help() { + cat < + defaults to "stable". + VERSION can be + - a version number like '2.2.0'. + - a version number with wildcard like '2.x' or '2.2.x', + which will be replaced by the latest of the specified serie. + - a branch like 'devel' or 'version-2-2' + --nim-channel + defaults to "stable". + The channel specifies the download source of the Nim compiler + - "stable" downloads from Nim website, for Linux and Windows (x86 and x86-64) only + - "nightly" downloads from https://github.com/nim-lang/nightlies/releases + use a branch name like 'devel' or 'version-2-2'. + For Linux (x86, x86-64, arm64), MacOS (x86-64 only), Windows (x86, x86-64) + - "source" builds the compiler from source https://github.com/nim-lang/Nim + --install-dir + defaults to "nim-install". + --os + defaults to host OS + --arch + defaults to host CPU architecture + -h, --help + prints this help +EOF +} + info() { echo "$(date +"$DATE_FORMAT")" $'\e[1m\e[36m[INF]\e[0m' "$@" } @@ -89,8 +123,10 @@ while ((0 < $#)); do --install-dir) cli_install_dir="$2"; shift 2;; --os) cli_os="$2"; shift 2;; --arch) cli_arch="$2"; shift 2;; + -h|--help) print-help; exit 0;; *) err "Unknown option '$opt'" + print-help exit 1 ;; esac @@ -190,7 +226,7 @@ CPU_ARCH=$(get-cpu-arch "${cli_arch}") OS=$(get-os "${cli_os}") NIM_CHANNEL=$(get-channel "${OS}" "${cli_nim_channel}") NIM_VERSION=$(get-version "${cli_nim_version:-"stable"}") # Depends on channel to add the `v` -NIM_INSTALL_DIR=${cli_install_dir:="$(pwd)/nim-binaries"} +NIM_INSTALL_DIR=${cli_install_dir:="$(pwd)/nim-install"} REPO_GITHUB_TOKEN="" # Placeholder info "✔ CPU architecture: ${CPU_ARCH}"