ci: Use XRPLF/prepare_actions (#2473)

This commit is contained in:
Ayaz Salikhov
2025-08-27 15:49:31 +01:00
committed by GitHub
parent 60baaf921f
commit b26fcae690
9 changed files with 7 additions and 83 deletions

View File

@@ -1,61 +0,0 @@
name: Prepare runner
description: Install packages, set environment variables, create directories
inputs:
disable_ccache:
description: Whether ccache should be disabled
required: true
runs:
using: composite
steps:
- name: Install packages on mac
if: ${{ runner.os == 'macOS' }}
shell: bash
run: |
echo "Removing unused packages on macOS, which were previously installed"
for pkg in bison gh jq llvm@14 pkg-config; do
brew uninstall "$pkg" || true
done
brew list
brew install --quiet \
ca-certificates \
ccache \
clang-build-analyzer \
cmake \
conan \
ninja
echo "/opt/homebrew/opt/conan@2/bin" >> $GITHUB_PATH
- name: Fix git permissions on Linux
if: ${{ runner.os == 'Linux' }}
shell: bash
run: git config --global --add safe.directory "$PWD"
- name: Set env variables for macOS
if: ${{ runner.os == 'macOS' }}
shell: bash
run: |
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV
echo "CONAN_HOME=${{ github.workspace }}/.conan2" >> $GITHUB_ENV
- name: Set env variables for Linux
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
echo "CCACHE_DIR=/root/.ccache" >> $GITHUB_ENV
echo "CONAN_HOME=/root/.conan2" >> $GITHUB_ENV
- name: Set CCACHE_DISABLE=1
if: ${{ inputs.disable_ccache == 'true' }}
shell: bash
run: |
echo "CCACHE_DISABLE=1" >> $GITHUB_ENV
- name: Create directories
shell: bash
run: |
mkdir -p "$CCACHE_DIR"
mkdir -p "$CONAN_HOME"