aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 64879bce68f1a9bbec30969a62c31ef88620baf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:
  schedule:
    - cron: '0 0 1 * *' # Monthly

env:
  RUN_SLOW_TESTS: 1

jobs:
  build:
    strategy:
      fail-fast: false

      matrix:
        configuration: [debug, release]

        include:
          - configuration: release
            release-flag: '--release'

    name: test - ${{ matrix.configuration }}
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v4
        with:
          show-progress: false

      - name: Install dependencies
        run: |
          sudo apt-get install -y software-properties-common
          sudo add-apt-repository -y ppa:pipewire-debian/pipewire-upstream
          sudo apt-get update -y
          sudo apt-get install -y libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev

      - name: Install Rust
        run: |
          rustup set auto-self-update check-only
          rustup toolchain install stable --profile minimal

      - uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.configuration }}

      - name: Build (no default features)
        run: cargo build ${{ matrix.release-flag }} --no-default-features

      - name: Build
        run: cargo build ${{ matrix.release-flag }}

      - name: Build (with profiling)
        run: cargo build ${{ matrix.release-flag }} --features profile-with-tracy

      - name: Build Tests
        run: cargo test --no-run --all ${{ matrix.release-flag }}

      - name: Test
        run: cargo test --all ${{ matrix.release-flag }} -- --nocapture

  clippy:
    strategy:
      fail-fast: false

    name: clippy
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v4
        with:
          show-progress: false

      - name: Install dependencies
        run: |
          sudo apt-get install -y software-properties-common
          sudo add-apt-repository -y ppa:pipewire-debian/pipewire-upstream
          sudo apt-get update -y
          sudo apt-get install -y libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev

      - name: Install Rust
        run: |
          rustup set auto-self-update check-only
          rustup toolchain install stable --profile minimal --component clippy

      - uses: Swatinem/rust-cache@v2

      - name: Run clippy
        run: cargo clippy --all --all-targets

  rustfmt:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v4
        with:
          show-progress: false

      - name: Install Rust
        run: |
          rustup set auto-self-update check-only
          rustup toolchain install nightly --profile minimal --component rustfmt
          rustup override set nightly

      - name: Run rustfmt
        run: cargo fmt --all -- --check