|
| 1 | +name: Code Quality Check |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + actions: write |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + formatting: |
| 18 | + name: Code Formatting Check |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Setup Node.js |
| 24 | + uses: actions/setup-node@v4 |
| 25 | + with: |
| 26 | + node-version: "20" |
| 27 | + cache: "npm" |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: npm ci |
| 31 | + |
| 32 | + - name: Check EditorConfig compliance |
| 33 | + uses: editorconfig-checker/action-editorconfig-checker@main |
| 34 | + |
| 35 | + - name: Run EditorConfig checker with exclusions |
| 36 | + run: editorconfig-checker -exclude 'Cargo\.lock|dist/.*|.*\.(md|icns|ico|png|jpg|jpeg|gif|svg|desktop|wxs|plist|toml)$|cli\.js$|node_modules/.*|target/.*|src-tauri/(target|icons|png)/.*' |
| 37 | + |
| 38 | + - name: Check Prettier formatting |
| 39 | + run: npx prettier --check . --ignore-unknown |
| 40 | + |
| 41 | + rust-quality: |
| 42 | + name: Rust Code Quality |
| 43 | + runs-on: ${{ matrix.os }} |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 47 | + fail-fast: false |
| 48 | + defaults: |
| 49 | + run: |
| 50 | + shell: bash |
| 51 | + working-directory: src-tauri |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 56 | + with: |
| 57 | + components: rustfmt, clippy |
| 58 | + |
| 59 | + - uses: rui314/setup-mold@v1 |
| 60 | + if: matrix.os == 'ubuntu-latest' |
| 61 | + |
| 62 | + - uses: taiki-e/install-action@v1 |
| 63 | + with: |
| 64 | + tool: cargo-hack |
| 65 | + |
| 66 | + - name: Install Ubuntu dependencies |
| 67 | + if: matrix.os == 'ubuntu-latest' |
| 68 | + |
| 69 | + with: |
| 70 | + packages: libdbus-1-dev libsoup3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra |
| 71 | + version: 1.0 |
| 72 | + |
| 73 | + - name: Check Rust formatting |
| 74 | + run: cargo fmt --all -- --color=always --check |
| 75 | + |
| 76 | + - name: Run Clippy lints |
| 77 | + run: cargo hack --feature-powerset --exclude-features cli-build --no-dev-deps clippy |
0 commit comments