Skip to content
49 changes: 42 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
flag-name: frontend
parallel: true

backend_tests:
ruby_tests:
runs-on: ubuntu-latest
env:
COVERAGE: 1
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
flag-name: backend
parallel: true

backend_linter:
ruby_linter:
runs-on: ubuntu-latest

defaults:
Expand All @@ -123,7 +123,7 @@ jobs:
- name: Rubocop
run: /usr/bin/rubocop.*-1.24.1

backend_doc:
ruby_doc:
runs-on: ubuntu-latest
env:
COVERAGE: 1
Expand Down Expand Up @@ -161,6 +161,44 @@ jobs:
- name: Check that introspected API and its docs have not diverged
run: make -C ../doc check

rust_ci:
runs-on: ubuntu-latest
env:
COVERAGE: 1

defaults:
run:
working-directory: ./rust

strategy:
fail-fast: false

container:
image: registry.opensuse.org/opensuse/tumbleweed:latest

steps:

- name: Git Checkout
uses: actions/checkout@v3

- name: Configure and refresh repositories
# disable unused repositories to have faster refresh
run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment which monster from another dimension is invoked by speaking zypper ref three times ! ! !

Copy link
Copy Markdown
Contributor

@mvidner mvidner Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see it is copied from other jobs, but still it would be nice to know. I prefer Cth*lhu to Candym*an. @lslezak ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that @lslezak do it to prevent ref failures


- name: Install Rust development files
run: zypper --non-interactive install rustup

- name: Install required packages
run: zypper --non-interactive install python-langtable-data openssl-3 libopenssl-3-devel

- name: Install Rust toolchains
run: rustup toolchain install stable

- name: Run the tests
run: cargo test --verbose

- name: Lint formatting
run: cargo fmt --all -- --check

integration-tests:
timeout-minutes: 60
Expand Down Expand Up @@ -203,9 +241,6 @@ jobs:
- name: Setup service
run: podman exec agama bash -c "cd /checkout; ./setup-service.sh"

- name: Rust unit tests
run: podman exec agama bash -c "cd /checkout/rust; cargo test --verbose"

- name: Set a testing Agama configuration
# copy a simplified ALP config file, it skips the product selection at the beginning
run: podman exec agama bash -c "cp /checkout/playwright/config/agama.yaml /checkout/service/etc/agama.yaml"
Expand Down Expand Up @@ -251,7 +286,7 @@ jobs:
finish:
runs-on: ubuntu-latest

needs: [frontend_build, backend_tests]
needs: [frontend_build, ruby_tests]

steps:

Expand Down
2 changes: 1 addition & 1 deletion rust/agama-dbus-server/src/network/system.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::network::{
dbus::Tree, model::Connection, nm::NetworkManagerAdapter, Action, Adapter, NetworkState
dbus::Tree, model::Connection, nm::NetworkManagerAdapter, Action, Adapter, NetworkState,
};
use agama_lib::error::ServiceError;
use std::error::Error;
Expand Down
10 changes: 4 additions & 6 deletions rust/agama-lib/src/install_settings.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//! Configuration settings handling
//!
//! This module implements the mechanisms to load and store the installation settings.
use crate::settings::{SettingObject, SettingValue, Settings};
use crate::{
network::NetworkSettings,
storage::StorageSettings,
software::SoftwareSettings,
users::UserSettings
network::NetworkSettings, software::SoftwareSettings, storage::StorageSettings,
users::UserSettings,
};
use crate::settings::{SettingObject, SettingValue, Settings};
use serde::{Deserialize, Serialize};
use std::default::Default;
use std::str::FromStr;
Expand Down Expand Up @@ -172,4 +170,4 @@ impl Settings for InstallSettings {
storage.merge(other_storage);
}
}
}
}
2 changes: 1 addition & 1 deletion rust/agama-lib/src/network.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Implements support for handling the network settings

mod client;
mod settings;
mod proxies;
mod settings;
mod store;
pub mod types;

Expand Down
2 changes: 1 addition & 1 deletion rust/agama-lib/src/proxies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ trait Questions1 {
size: &str,
attempt: u8,
) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
}
}
2 changes: 1 addition & 1 deletion rust/agama-lib/src/software.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mod store;

pub use client::SoftwareClient;
pub use settings::SoftwareSettings;
pub use store::SoftwareStore;
pub use store::SoftwareStore;
2 changes: 1 addition & 1 deletion rust/agama-lib/src/software/store.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Implements the store for the storage settings.

use super::{SoftwareClient, SoftwareSettings};
use crate::error::{ServiceError, WrongParameter};
use super::{SoftwareSettings, SoftwareClient};
use std::error::Error;
use zbus::Connection;

Expand Down
2 changes: 1 addition & 1 deletion rust/agama-lib/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mod store;

pub use client::StorageClient;
pub use settings::StorageSettings;
pub use store::StorageStore;
pub use store::StorageStore;
1 change: 0 additions & 1 deletion rust/agama-lib/src/storage/proxies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,3 @@ trait StorageProposal {
&self,
) -> zbus::Result<Vec<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>>;
}

2 changes: 1 addition & 1 deletion rust/agama-lib/src/storage/store.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Implements the store for the storage settings.

use crate::error::ServiceError;
use super::{StorageClient, StorageSettings};
use crate::error::ServiceError;
use std::default::Default;
use std::error::Error;
use zbus::Connection;
Expand Down
6 changes: 3 additions & 3 deletions rust/agama-lib/src/users.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Implements support for handling the users settings

mod client;
mod settings;
mod proxies;
mod settings;
mod store;

pub use client::{UsersClient, FirstUser};
pub use client::{FirstUser, UsersClient};
pub use settings::{FirstUserSettings, RootUserSettings, UserSettings};
pub use store::UsersStore;
pub use store::UsersStore;
2 changes: 1 addition & 1 deletion rust/agama-lib/src/users/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ impl<'a> UsersClient<'a> {
)
.await
}
}
}
2 changes: 1 addition & 1 deletion rust/agama-lib/src/users/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ mod tests {
user1.merge(&user2);
assert_eq!(user1.full_name.unwrap(), "Jane Doe")
}
}
}
2 changes: 1 addition & 1 deletion rust/agama-lib/src/users/store.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{FirstUser, FirstUserSettings, RootUserSettings, UserSettings, UsersClient};
use crate::error::WrongParameter;
use super::{FirstUserSettings, RootUserSettings, UserSettings, UsersClient, FirstUser};
use std::error::Error;
use zbus::Connection;

Expand Down