Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify github workflows #8

Merged
merged 3 commits into from
Apr 27, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
os: macOS-latest
features: auto-splitting
cross: skip
install_target: true

- label: macOS x86_64-v3
target: x86_64-apple-darwin
Expand All @@ -116,6 +117,7 @@ jobs:
os: macOS-latest
features: auto-splitting
cross: skip
install_target: true

steps:
- name: Checkout Commit
Expand All @@ -124,7 +126,7 @@ jobs:
- name: Install Rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.toolchain || 'stable' }}
rust-version: 'stable'

- name: Install Target
if: matrix.install_target != ''
Expand Down Expand Up @@ -157,20 +159,20 @@ jobs:
env:
TARGET: ${{ matrix.target }}
SKIP_CROSS: ${{ matrix.cross }}
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }}
IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') }}
FEATURES: ${{ matrix.features }}
RUSTFLAGS: ${{ matrix.rust_flags }}

- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
if: startsWith(github.ref, 'refs/tags/')
run: bash .github/workflows/before_deploy.sh
env:
OS_NAME: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
RELEASE_TARGET: ${{ matrix.target_rename || matrix.target }}

- name: Release
if: startsWith(github.ref, 'refs/tags/') && matrix.release == ''
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: livesplit-one-*.*
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#[serde(skip)]
can_save: bool,
#[serde(default)]
history: BTreeMap<Arc<str>, BTreeMap<Arc<str>, BTreeSet<Arc<Path>>>>,

Check warning on line 48 in src/config.rs

View workflow job for this annotation

GitHub Actions / clippy

very complex type used. Consider factoring parts into `type` definitions
}

impl Splits {
Expand Down Expand Up @@ -149,7 +149,7 @@
fs::write(CONFIG_PATH.as_path(), buf).ok()
}

pub fn splits_history(&self) -> &BTreeMap<Arc<str>, BTreeMap<Arc<str>, BTreeSet<Arc<Path>>>> {

Check warning on line 152 in src/config.rs

View workflow job for this annotation

GitHub Actions / clippy

very complex type used. Consider factoring parts into `type` definitions
&self.splits.history
}

Expand Down Expand Up @@ -248,9 +248,10 @@
}

pub fn open_splits(
&mut self,

Check failure on line 251 in src/config.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/livesplit-one-druid/livesplit-one-druid/src/config.rs
shared_timer: &SharedTimer,
layout_data: &mut LayoutData,
#[cfg(feature = "auto-splitting")]
auto_splitter: &livesplit_core::auto_splitting::Runtime,
path: PathBuf,
) -> Result<()> {
Expand Down Expand Up @@ -454,7 +455,7 @@
.show_titlebar(false)
.transparent(true)
.set_always_on_top(true)
}

Check failure on line 458 in src/config.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/livesplit-one-druid/livesplit-one-druid/src/config.rs

#[cfg(feature = "auto-splitting")]
pub fn maybe_load_auto_splitter(&self, runtime: &livesplit_core::auto_splitting::Runtime, timer: SharedTimer) {
Expand All @@ -464,7 +465,7 @@
log::error!("Auto Splitter failed to load: {}", e);
}
}
}

Check failure on line 468 in src/config.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/livesplit-one-druid/livesplit-one-druid/src/config.rs

#[cfg(feature = "auto-splitting")]
pub fn maybe_replace_auto_splitter(&self, runtime: &livesplit_core::auto_splitting::Runtime, timer: SharedTimer) {
Expand All @@ -484,7 +485,7 @@
let mut run = Run::new();
run.push_segment(Segment::new("Time"));
run
}

Check failure on line 488 in src/config.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/livesplit-one-druid/livesplit-one-druid/src/config.rs

pub fn show_error(error: anyhow::Error) {
// this MessageDialog is for displaying errors,
Expand Down
1 change: 1 addition & 0 deletions src/timer_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@
let result = data.config.borrow_mut().open_splits(
&data.timer,
&mut data.layout_data.borrow_mut(),
#[cfg(feature = "auto-splitting")]
&data.auto_splitter,
file_info.path().to_path_buf(),
);
Expand Down Expand Up @@ -865,7 +866,7 @@
data.config.borrow_mut().set_hotkeys(hotkey_config);
}
data.settings_editor = None;
let _ = HOTKEY_SYSTEM.write().unwrap().as_mut().unwrap().activate();

Check warning on line 869 in src/timer_form.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded `return` statement
return;
}
}
Expand Down
Loading