name: 'Setup Bazel (Bazelisk)' description: 'Installs Node, Bazelisk, and configures Git for private SSH dependencies.' inputs: node_version: description: 'Node.js version' required: false default: '24' git_token: description: 'Gitea token for private dependency authentication' required: false default: '' cache: description: 'Used to specify a package manager for caching in actions/setup-node' required: false default: '' runs: using: 'composite' steps: - name: Fix MTU size for Proxmox/Docker network compatibility shell: bash run: | if ! command -v ip &> /dev/null; then if command -v apt-get &> /dev/null && [ "$(id -u)" -eq 0 ]; then echo "ip command not found. Installing iproute2..." apt-get update -qy && apt-get install -qy iproute2 || true else echo "ip command not found and cannot install. Skipping MTU configuration." fi fi if command -v ip &> /dev/null; then DEFAULT_INTERFACE=$(ip route show | grep default | awk '{print $5}') if [ -n "$DEFAULT_INTERFACE" ]; then echo "Setting MTU of $DEFAULT_INTERFACE to 1400..." if [ "$(id -u)" -eq 0 ]; then ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true else sudo ip link set dev "$DEFAULT_INTERFACE" mtu 1400 || true fi fi fi - name: Setup Node uses: actions/setup-node@v4 with: node-version: ${{ inputs.node_version }} cache: ${{ inputs.cache }} - name: Set up Bazel (Bazelisk) shell: bash run: | if ! command -v bazel &> /dev/null && ! command -v bazelisk &> /dev/null; then npm install -g @bazel/bazelisk fi - name: Configure Git for private SSH dependencies if: ${{ inputs.git_token != '' }} shell: bash run: | git config --global url."https://${{ inputs.git_token }}@git.rodydavis.dev/".insteadOf "ssh://git@git.rodydavis.dev:2222/"