-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.57 KB
/
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
name: Rust
on:
push:
branches-ignore:
- 'dependabot/**'
- 'pr/**'
tags:
- 'v*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update
- run: sudo apt-get install libmpv-dev
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/
~/.cargo/git/
~/.rustup/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: |
cargo build --release --locked --target x86_64-unknown-linux-gnu
- if: startsWith(github.ref, 'refs/tags/v')
run: cp target/x86_64-unknown-linux-gnu/release/libmpv_mpris2.so mpris-x86_64-unknown-linux-gnu.so
- if: startsWith(github.ref, 'refs/tags/v')
run: strip --strip-unneeded mpris-x86_64-unknown-linux-gnu.so
- if: startsWith(github.ref, 'refs/tags/v')
name: Release
uses: softprops/action-gh-release@v2
with:
files: mpris-x86_64-unknown-linux-gnu.so
- name: Install required clippy tools
run: cargo install clippy-sarif sarif-fmt
continue-on-error: true
- name: Run rust-clippy
run: cargo clippy --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true