gitbutler/.github/actions/init-env-rust/action.yaml

42 lines
1.3 KiB
YAML
Raw Normal View History

2023-09-14 10:30:38 +03:00
name: init-rust
description: prepare runner for rust related tasks
inputs:
rust:
2023-10-19 11:03:50 +03:00
description: "rust version"
required: false
2023-10-19 11:03:50 +03:00
default: "stable"
2023-09-14 09:54:23 +03:00
runs:
using: "composite"
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
2023-09-14 09:54:23 +03:00
with:
toolchain: ${{ inputs.rust }}
2023-09-14 09:54:23 +03:00
components: rustfmt, clippy
- name: Cache rust dependencies
2023-10-19 11:03:50 +03:00
if: runner.labels != 'self-hosted' # internet in berlin is very slow
2023-09-14 09:54:23 +03:00
uses: Swatinem/rust-cache@v2
2023-09-14 10:05:12 +03:00
- if: runner.os == 'Linux'
shell: bash
run: sudo apt-get update
2023-09-14 09:54:23 +03:00
- name: uninstall homebrew
2023-09-14 10:05:12 +03:00
# github's linux runner has homebrew installed which messes up with pkg-config.
2023-09-14 09:54:23 +03:00
if: runner.os == 'Linux' && runner.arch == 'X64'
2023-09-14 10:05:12 +03:00
shell: bash
run: NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
2023-09-14 09:54:23 +03:00
- name: install linux dependencies
2023-09-14 10:05:12 +03:00
# self hosted Linux ARM64 runner (in berlin) has this baked in
if: runner.os == 'Linux' && runner.arch != 'ARM64'
shell: bash
2023-09-14 09:54:23 +03:00
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
2023-10-19 13:50:24 +03:00
2023-10-19 14:08:08 +03:00
- name: placeholder for ui assets
2023-10-19 13:50:24 +03:00
shell: bash
run: mkdir packages/ui/build