2023-09-14 10:30:38 +03:00
|
|
|
name: init-rust
|
|
|
|
description: prepare runner for rust related tasks
|
2023-10-18 13:52:37 +03:00
|
|
|
inputs:
|
|
|
|
rust:
|
|
|
|
description: 'rust version'
|
|
|
|
required: false
|
|
|
|
default: 'stable'
|
2023-09-14 09:54:23 +03:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2023-10-18 13:52:37 +03:00
|
|
|
- name: Install Rust
|
|
|
|
uses: dtolnay/rust-toolchain@master
|
2023-09-14 09:54:23 +03:00
|
|
|
with:
|
2023-10-18 13:52:37 +03:00
|
|
|
toolchain: ${{ inputs.rust }}
|
2023-09-14 09:54:23 +03:00
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Cache rust dependencies
|
|
|
|
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
|