Skip to content

Commit 193b311

Browse files
committed
ci: update ci and focus on macOS
Signed-off-by: Sergio Lopez <slp@redhat.com>
1 parent 26e7c5c commit 193b311

2 files changed

Lines changed: 54 additions & 39 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Setup Build Environment'
2+
description: 'Common setup for Rust builds with all required packages (Linux & macOS)'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install Rust toolchain
7+
shell: bash
8+
run: |
9+
rustup update stable
10+
rustup default stable
11+
rustup component add rustfmt clippy
12+
13+
- name: Cache Cargo dependencies
14+
uses: actions/cache@v4
15+
with:
16+
path: |
17+
~/.cargo/registry
18+
~/.cargo/git
19+
target
20+
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
21+
22+
- name: Set up Homebrew (macOS)
23+
if: runner.os == 'macOS'
24+
uses: Homebrew/actions/setup-homebrew@master
25+
26+
- name: Install packages (macOS)
27+
if: runner.os == 'macOS'
28+
shell: bash
29+
run: brew tap slp/krun && brew install asciidoctor libkrun clang-format llvm
30+
31+
- name: Install packages (Linux)
32+
if: runner.os == 'Linux'
33+
shell: bash
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y \
37+
libvirglrenderer-dev \
38+
libepoxy-dev \
39+
libdrm-dev \
40+
libpipewire-0.3-dev \
41+
clang-format \
42+
libclang-dev

.github/workflows/code_quality.yml

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,15 @@
1-
name: Code Quality (rustfmt and clippy)
2-
on: [pull_request, create]
1+
name: Code Quality
2+
on: [pull_request]
33

44
jobs:
5-
build:
6-
if: github.event_name == 'pull_request'
7-
name: Code Quality (clippy, rustfmt)
8-
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
rust:
12-
- stable
13-
target:
14-
- x86_64-unknown-linux-gnu
5+
code-quality-macos:
6+
name: libkrun (macOS aarch64)
7+
runs-on: macos-latest
158
steps:
16-
- name: Code checkout
17-
uses: actions/checkout@v2
18-
- name: Install Rust toolchain (${{ matrix.rust }})
19-
uses: actions-rs/toolchain@v1
20-
with:
21-
toolchain: ${{ matrix.rust }}
22-
target: ${{ matrix.target }}
23-
override: true
24-
components: rustfmt, clippy
25-
26-
- name: Install asciidoctor
27-
run: sudo apt-get install -y asciidoctor
28-
29-
- name: Install additional Rust rust targets
30-
run: rustup target add aarch64-unknown-linux-gnu aarch64-apple-darwin
31-
32-
- name: Formatting (rustfmt)
33-
run: cargo fmt -- --check
34-
35-
- name: Clippy x86_64-unknown-linux-gnu (all features)
36-
run: cargo clippy --all-features --target x86_64-unknown-linux-gnu
37-
38-
- name: Clippy aarch64-unknown-linux-gnu (all features)
39-
run: cargo clippy --all-features --target aarch64-unknown-linux-gnu
40-
41-
- name: Clippy aarch64-apple-darwin (all features)
42-
run: cargo clippy --all-features --target aarch64-apple-darwin
9+
- uses: actions/checkout@v4
10+
11+
- name: Setup build environment
12+
uses: ./.github/actions/setup-build-env
13+
14+
- name: Clippy (efi+gpu)
15+
run: cargo clippy --locked -- -D warnings

0 commit comments

Comments
 (0)