gitbutler/.github/actions/init-env-rust/action.yaml
2023-12-22 14:22:54 +01:00

42 lines
1.3 KiB
YAML

name: init-rust
description: prepare runner for rust related tasks
inputs:
rust:
description: "rust version"
required: false
default: "stable"
runs:
using: "composite"
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ inputs.rust }}
components: rustfmt, clippy
- name: Cache rust dependencies
if: runner.name != 'ScottsMacStudio' # internet in berlin is very slow
uses: Swatinem/rust-cache@v2
- if: runner.os == 'Linux'
shell: bash
run: sudo apt-get update
- name: uninstall homebrew
# github's linux runner has homebrew installed which messes up with pkg-config.
if: runner.os == 'Linux' && runner.arch == 'X64'
shell: bash
run: NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
- name: install linux dependencies
# self hosted Linux ARM64 runner (in berlin) has this baked in
if: runner.os == 'Linux' && runner.arch != 'ARM64'
shell: bash
run: |
sudo apt-get update
sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
- name: placeholder for ui assets
shell: bash
run: mkdir gitbutler-ui/build