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
47 changes: 40 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,57 @@ on:
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/rust.yml'
pull_request:
branches:
- master
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/rust.yml'

env:
CARGO_TERM_COLOR: always

jobs:
build:

build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [latest, 1.86.0, 1.77.2]

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Cargo & target directories
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.rust }}-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-${{ runner.os }}-

- name: Build (${{ matrix.rust }})
run: |
docker run --rm --user "$(id -u):$(id -g)" \
-v "${HOME}/.cargo":/usr/local/cargo \
-v "$(pwd)":/work -w /work \
rust:${{ matrix.rust }} \
cargo build --verbose --release

- name: Run tests (${{ matrix.rust }})
run: |
docker run --rm --user "$(id -u):$(id -g)" \
-v "${HOME}/.cargo":/usr/local/cargo \
-v "$(pwd)":/work -w /work \
rust:${{ matrix.rust }} \
cargo test --verbose
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions src/commands/edge_app/setting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ impl EdgeAppCommand {
setting_key: &str,
setting_value: &str,
) -> Result<(), CommandError> {
let installation_id = match self.get_installation_id(path.clone()) {
Ok(id) => Some(id),
Err(_) => None,
};
let installation_id = self.get_installation_id(path.clone()).ok();
let actual_installation_id = match installation_id {
Some(id) => id.clone(),
None => "".to_string(),
Expand Down
8 changes: 7 additions & 1 deletion src/commands/edge_app/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,13 @@ mod tests {
temp_env::with_var(INSTANCE_FILE_NAME_ENV, Some("instance2.yml"), || {
let result = transform_instance_path_to_instance_manifest(&None);
assert!(result.is_ok());
assert_eq!(result.unwrap(), dir_path.join("instance2.yml"));
let expected_path = dir_path.join("instance2.yml");
// Compare only the file names to avoid issues with temp dir path differences
assert_eq!(
result.unwrap().file_name(),
expected_path.file_name(),
"Expected filename did not match"
);
});
}

Expand Down
Loading