style: rustfmt the v1.0.1 feature code #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| rust: | |
| name: Rust ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, windows-2022, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Linux build deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev pkg-config \ | |
| libwebkit2gtk-4.1-dev libgtk-3-dev libsoup-3.0-dev \ | |
| libayatana-appindicator3-dev librsvg2-dev libi2c-dev | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: rustfmt --check | |
| run: cargo fmt --all -- --check | |
| - name: cargo check (workspace) | |
| run: cargo check --workspace --all-targets | |
| - name: cargo clippy (core + cli) | |
| run: cargo clippy -p brightness-core -p brightness-cli --all-targets | |
| - name: cargo test | |
| run: cargo test -p brightness-core --no-fail-fast | |
| - name: cargo build --release (cli) | |
| run: cargo build --release -p brightness-cli | |
| frontend: | |
| name: Frontend | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: app/package-lock.json | |
| - name: Install dependencies | |
| working-directory: app | |
| run: npm ci | |
| - name: Type-check + build | |
| working-directory: app | |
| run: npm run build | |
| bundle: | |
| name: Tauri bundle ${{ matrix.os }} | |
| needs: [rust, frontend] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| - os: windows-2022 | |
| target: x86_64-pc-windows-msvc | |
| - os: macos-14 | |
| target: aarch64-apple-darwin | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Linux build deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev pkg-config \ | |
| libwebkit2gtk-4.1-dev libgtk-3-dev libsoup-3.0-dev \ | |
| libayatana-appindicator3-dev librsvg2-dev libi2c-dev | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: app/package-lock.json | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install Tauri CLI | |
| run: cargo install tauri-cli --version "^2.0" --locked | |
| - name: Frontend install | |
| working-directory: app | |
| run: npm ci | |
| - name: Tauri build | |
| working-directory: app/src-tauri | |
| run: cargo tauri build --target ${{ matrix.target }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: bundle-${{ matrix.target }} | |
| path: | | |
| target/${{ matrix.target }}/release/bundle/**/*.deb | |
| target/${{ matrix.target }}/release/bundle/**/*.AppImage | |
| target/${{ matrix.target }}/release/bundle/**/*.rpm | |
| target/${{ matrix.target }}/release/bundle/**/*.dmg | |
| target/${{ matrix.target }}/release/bundle/**/*.app | |
| target/${{ matrix.target }}/release/bundle/**/*.msi | |
| target/${{ matrix.target }}/release/bundle/**/*.exe | |
| if-no-files-found: warn |