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 # Apple Silicon if [ $(uname -m) = "x86_64" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # Intel 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.91.1 install svm-rs --version =0.5.22 svm install 0.8.29 svm use 0.8.29 - 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@e61617a16c407a86262fb923c35a616ddbe070b3 # 4.6.0 with: rootless: true set-host: true if: runner.os == 'Linux'