Merge pull request #128 from linux-credentials/push-qknnzzyyqrpk #223
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: Build project | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_HOME: build/cargo-home | |
| CARGO_TARGET_DIR: ${{ github.workspace }}/build/target | |
| jobs: | |
| build: | |
| env: | |
| RUST_LOG: debug | |
| name: Build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - run: rustup show active-toolchain | |
| - run: rustup component add rustfmt clippy | |
| - name: Configure Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: ". -> build/target" | |
| cache-workspace-crates: true | |
| - name: Update apt cache | |
| run: sudo apt update | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt install -y --no-install-recommends \ | |
| curl git build-essential \ | |
| libgtk-4-dev libclang-dev libdbus-1-dev libssl-dev libudev-dev libnfc-dev \ | |
| libpcsclite-dev libxml2-utils \ | |
| blueprint-compiler desktop-file-utils gettext ninja-build python3-pip \ | |
| udev zip | |
| - name: Set up mold as default linker | |
| uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 | |
| - name: Install Meson | |
| run: | | |
| # Newer version needed for --interactive flag needed below | |
| python3 -m pip install --user -v 'meson==1.5.0' | |
| - name: Setup meson project | |
| run: meson setup -Dprofile=development -Dcargo_locked=true build | |
| - name: Build | |
| run: ninja -C build | |
| - name: Test | |
| # We have to use the --interactive flag because of some | |
| # weird issue with meson hanging after cargo exits due to the TestDBus. | |
| # Probably has to do with forking the test processes. | |
| run: meson test --interactive | |
| working-directory: build/ | |
| - name: Check clippy recommendations | |
| run: cargo clippy --locked --workspace --all-features --target-dir build/target | |
| - name: Check formatting | |
| run: cargo fmt --all --check |