Pi66

pind
Simple Rust hotkey daemon.
git clone https://git.pi66.xyz/pind

libs/evdevv/.github/workflows/rust.yml

 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
name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Format
      run: cargo fmt --check
    - name: Clippy
      run: cargo clippy && cargo clippy --all-features
    - name: Build
      run: cargo build --verbose --all-features
    - name: Run tests
      run: cargo test --verbose
    - name: Doc
      run: cargo doc --all-features
    - name: Run device tests
      run: sudo -E env "PATH=$PATH" cargo test --tests --features device-test

  cross-linux:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target:
        - arch: 'aarch64'
          rust: 'aarch64-unknown-linux-gnu'
          os: 'aarch64-linux-gnu'
        - arch: 'arm'
          rust: 'armv7-unknown-linux-gnueabihf'
          os: 'arm-linux-gnueabihf'
        - arch: 'i386'
          rust: 'i686-unknown-linux-gnu'
          os: 'i686-linux-gnu'

    steps:
    - uses: actions/checkout@v3
    - name: Install Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
        override: true
        components: rustfmt, clippy
        target: ${{ matrix.target.rust }}
    - name: Install QEMU and toolchain
      run: |
        sudo apt update
        sudo apt -y install qemu-user qemu-user-static gcc-<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mrow><mi>m</mi><mi>a</mi><mi>t</mi><mi>r</mi><mi>i</mi><mi>x</mi><mo>&#x0002E;</mo><mi>t</mi><mi>a</mi><mi>r</mi><mi>g</mi><mi>e</mi><mi>t</mi><mo>&#x0002E;</mo><mi>o</mi><mi>s</mi></mrow></mrow><mi>b</mi><mi>i</mi><mi>n</mi><mi>u</mi><mi>t</mi><mi>i</mi><mi>l</mi><mi>s</mi><mo>&#x02212;</mo></mrow></math>{{ matrix.target.os }} binutils-${{ matrix.target.os }}-dbg
    - name: Append .cargo config
      run: |
        echo "[target.${{ matrix.target.rust }}]" >> ~/.cargo/config
        echo "runner = \"qemu-<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mrow><mi>m</mi><mi>a</mi><mi>t</mi><mi>r</mi><mi>i</mi><mi>x</mi><mo>&#x0002E;</mo><mi>t</mi><mi>a</mi><mi>r</mi><mi>g</mi><mi>e</mi><mi>t</mi><mo>&#x0002E;</mo><mi>a</mi><mi>r</mi><mi>c</mi><mi>h</mi></mrow></mrow><mo>&#x02212;</mo><mi>L</mi><mo>&#x0002F;</mo><mi>u</mi><mi>s</mi><mi>r</mi><mo>&#x0002F;</mo></mrow></math>{{ matrix.target.os }}/\"" >> ~/.cargo/config
        echo "linker = \"${{ matrix.target.os }}-gcc\"" >> ~/.cargo/config
    - name: Build
      run: cargo build --target ${{ matrix.target.rust }}
    - name: Run tests
      run: cargo test --target ${{ matrix.target.rust }}
    - name: Doc
      run: cargo doc --target ${{ matrix.target.rust }}

  freebsd:
    runs-on: ubuntu-latest
    name: build (FreeBSD)
    steps:
    - uses: actions/checkout@v3
    - name: Build
      uses: vmactions/freebsd-vm@v1
      with:
        envs: 'RUSTFLAGS'
        usesh: true
        prepare: |
          pkg install -y curl

        run: |
          curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
          . "$HOME/.cargo/env"
          cargo build --all-features
          cargo test