Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
- main
pull_request:

env:
CARGO_TERM_COLOR: always
CARGO_HOME: build/cargo-home
CARGO_TARGET_DIR: ${{ github.workspace }}/build/target

jobs:
build:
env:
Expand All @@ -13,6 +18,17 @@ jobs:
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
Expand All @@ -23,32 +39,26 @@ jobs:
libpcsclite-dev libxml2-utils \
blueprint-compiler desktop-file-utils gettext ninja-build python3-pip \
udev zip

- 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 build
run: meson setup -Dprofile=development 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 (Common)
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credentialsd-common/Cargo.toml --target-dir build/credentialsd-common/target/release
- name: Check clippy recommendations (UI)
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credentialsd-ui/Cargo.toml --target-dir build/credentialsd-ui/target/release
- name: Check clippy recommendations (Server)
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credentialsd/Cargo.toml --target-dir build/credentialsd/target/release
- name: Check formatting (Common)
run: cargo fmt --check
working-directory: credentialsd-common
- name: Check formatting (UI)
run: cargo fmt --check
working-directory: credentialsd-ui
- name: Check formatting (Server)
run: cargo fmt --check
working-directory: credentialsd

- name: Check clippy recommendations
run: cargo clippy --locked --workspace --all-features --target-dir build/target

- name: Check formatting
run: cargo fmt --all --check
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Rust
target/
/Cargo.lock

# Python
/env
Expand All @@ -18,5 +17,5 @@ __pycache__
/vendor

# IDE
/.vscode
/.vscode/settings.json
.idea
25 changes: 25 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "meson",
"target": "credentialsd",
"mode": "build",
"problemMatcher": [
"$meson-gcc"
],
"group": "build",
"label": "Meson: Build Daemon"
},
{
"type": "meson",
"target": "credentialsd-ui",
"mode": "build",
"problemMatcher": [
"$meson-gcc"
],
"group": "build",
"label": "Meson: Build UI"
}
]
}
Loading