name: build-dependencies description: Installs build dependencies for Serai runs: using: "composite" steps: - name: Remove unused packages shell: bash run: | # Ensure the repositories are synced sudo apt update -y # Actually perform the removals sudo apt remove -y "*powershell*" "*nuget*" "*bazel*" "*ansible*" "*terraform*" "*heroku*" "*aws*" azure-cli sudo apt remove -y "*nodejs*" "*npm*" "*yarn*" "*java*" "*kotlin*" "*golang*" "*swift*" "*julia*" "*fortran*" "*android*" sudo apt remove -y "*apache2*" "*nginx*" "*firefox*" "*chromium*" "*chrome*" "*edge*" sudo apt remove -y --allow-remove-essential -f shim-signed *python3* # This removal command requires the prior removals due to unmet dependencies otherwise sudo apt remove -y "*qemu*" "*sql*" "*texinfo*" "*imagemagick*" # Reinstall python3 as a general dependency of a functional operating system sudo apt install -y python3 --fix-missing if: runner.os == 'Linux' - name: Remove unused packages shell: bash run: | (gem uninstall -aIx) || (exit 0) brew uninstall --force "*msbuild*" "*powershell*" "*nuget*" "*bazel*" "*ansible*" "*terraform*" "*heroku*" "*aws*" azure-cli brew uninstall --force "*nodejs*" "*npm*" "*yarn*" "*java*" "*kotlin*" "*golang*" "*swift*" "*julia*" "*fortran*" "*android*" brew uninstall --force "*apache2*" "*nginx*" "*firefox*" "*chromium*" "*chrome*" "*edge*" brew uninstall --force "*qemu*" "*sql*" "*texinfo*" "*imagemagick*" brew cleanup if: runner.os == 'macOS' - name: Install dependencies shell: bash run: | if [ "$RUNNER_OS" == "Linux" ]; then sudo apt install -y ca-certificates protobuf-compiler libclang-dev elif [ "$RUNNER_OS" == "Windows" ]; then choco install protoc elif [ "$RUNNER_OS" == "macOS" ]; then brew install protobuf llvm HOMEBREW_ROOT_PATH=/opt/homebrew # macOS 14+ if [ $(sw_vers -productVersion | awk -F "." '{ print $1 }') = "13" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # macOS 13 ls $HOMEBREW_ROOT_PATH/opt/llvm/lib | grep "libclang.dylib" # Make sure this installed `libclang` echo "DYLD_LIBRARY_PATH=$HOMEBREW_ROOT_PATH/opt/llvm/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV" fi - name: Install solc shell: bash run: | cargo +1.89 install svm-rs --version =0.5.18 svm install 0.8.26 svm use 0.8.26 - name: Remove preinstalled Docker shell: bash run: | docker system prune -a --volumes sudo apt remove -y *docker* # Install uidmap which will be required for the explicitly installed Docker sudo apt install uidmap if: runner.os == 'Linux' - name: Update system dependencies shell: bash run: | sudo apt update -y sudo apt upgrade -y sudo apt autoremove -y sudo apt clean if: runner.os == 'Linux' - name: Install rootless Docker uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19 with: rootless: true set-host: true if: runner.os == 'Linux' # - name: Cache Rust # uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43