|
1 | | -name: Code Quality (rustfmt and clippy) |
| 1 | +name: linux-x86_64 |
2 | 2 | on: [pull_request, create] |
3 | 3 |
|
4 | 4 | jobs: |
5 | 5 | build: |
6 | 6 | if: github.event_name == 'pull_request' |
7 | | - name: Code Quality (clippy, rustfmt) |
| 7 | + name: Code Quality (fmt, clippy) |
8 | 8 | runs-on: ubuntu-latest |
9 | | - strategy: |
10 | | - matrix: |
11 | | - rust: |
12 | | - - stable |
13 | | - target: |
14 | | - - x86_64-unknown-linux-gnu |
15 | 9 | steps: |
16 | 10 | - name: Code checkout |
17 | 11 | uses: actions/checkout@v2 |
18 | | - - name: Install Rust toolchain (${{ matrix.rust }}) |
| 12 | + - name: Install Rust toolchain |
19 | 13 | uses: actions-rs/toolchain@v1 |
20 | 14 | with: |
21 | | - toolchain: ${{ matrix.rust }} |
22 | | - target: ${{ matrix.target }} |
23 | | - override: true |
| 15 | + toolchain: stable |
24 | 16 | components: rustfmt, clippy |
25 | 17 |
|
26 | 18 | - name: Install packages |
|
40 | 32 |
|
41 | 33 | - name: Clippy (net+blk+gpu+snd features) |
42 | 34 | run: cargo clippy --features net,blk,gpu,snd -- -D warnings |
| 35 | + |
| 36 | + unit: |
| 37 | + if: github.event_name == 'pull_request' |
| 38 | + name: Unit Tests |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - name: Code checkout |
| 42 | + uses: actions/checkout@v2 |
| 43 | + - name: Install Rust toolchain |
| 44 | + uses: actions-rs/toolchain@v1 |
| 45 | + with: |
| 46 | + toolchain: stable |
| 47 | + components: rustfmt, clippy |
| 48 | + |
| 49 | + - name: Install packages |
| 50 | + run: sudo apt-get update && sudo apt-get install -y libvirglrenderer-dev libepoxy-dev libdrm-dev libpipewire-0.3-dev |
| 51 | + |
| 52 | + - name: Create a fake init |
| 53 | + run: touch init/init |
| 54 | + |
| 55 | + - name: Unit tests |
| 56 | + run: cargo test |
| 57 | + |
| 58 | + integration: |
| 59 | + if: github.event_name == 'pull_request' |
| 60 | + name: Integration Tests |
| 61 | + runs-on: ubuntu-latest |
| 62 | + steps: |
| 63 | + - name: Code checkout |
| 64 | + uses: actions/checkout@v2 |
| 65 | + - name: Install Rust toolchain |
| 66 | + uses: actions-rs/toolchain@v1 |
| 67 | + with: |
| 68 | + toolchain: stable |
| 69 | + target: x86_64-unknown-linux-musl |
| 70 | + |
| 71 | + - name: Enable KVM group perms |
| 72 | + run: | |
| 73 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 74 | + sudo udevadm control --reload-rules |
| 75 | + sudo udevadm trigger --name-match=kvm |
| 76 | + sudo usermod -a -G kvm $USER |
| 77 | +
|
| 78 | + - name: Install packages |
| 79 | + run: sudo apt-get update && sudo apt-get install -y build-essential patchelf libclang-dev pkg-config net-tools libvirglrenderer-dev libepoxy-dev libdrm-dev libpipewire-0.3-dev |
| 80 | + |
| 81 | + - name: Install libkrunfw |
| 82 | + run: curl -L -o /tmp/libkrunfw-4.9.0-x86_64.tgz https://github.com/containers/libkrunfw/releases/download/v4.9.0/libkrunfw-4.9.0-x86_64.tgz && mkdir tmp && tar xf /tmp/libkrunfw-4.9.0-x86_64.tgz -C tmp && sudo mv tmp/lib64/* /lib/x86_64-linux-gnu |
| 83 | + |
| 84 | + - name: Integration tests |
| 85 | + run: KRUN_NO_UNSHARE=1 make test |
0 commit comments