mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-25 12:21:55 +02:00
chore(ci): run rust build/test/check on 3 platforms (#1675)
* chore(ci): run rust build/test/check on 3 platforms * need to properly test windows * do not need to strip here, and windows has a suffix anyway
This commit is contained in:
parent
3ff2e2552f
commit
6a2576fc5b
17
.github/workflows/rust.yml
vendored
17
.github/workflows/rust.yml
vendored
@ -11,7 +11,10 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-14, windows-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -39,10 +42,13 @@ jobs:
|
|||||||
run: cargo build -p atuin-server --locked --release
|
run: cargo build -p atuin-server --locked --release
|
||||||
|
|
||||||
- name: Run cargo build main
|
- name: Run cargo build main
|
||||||
run: cargo build --all --locked --release && strip target/release/atuin
|
run: cargo build --all --locked --release
|
||||||
|
|
||||||
unit-test:
|
unit-test:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-14, windows-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -64,7 +70,10 @@ jobs:
|
|||||||
run: cargo test --lib --bins
|
run: cargo test --lib --bins
|
||||||
|
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-14, windows-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -211,7 +211,13 @@ impl HistoryStore {
|
|||||||
|
|
||||||
pub async fn incremental_build(&self, database: &dyn Database, ids: &[RecordId]) -> Result<()> {
|
pub async fn incremental_build(&self, database: &dyn Database, ids: &[RecordId]) -> Result<()> {
|
||||||
for id in ids {
|
for id in ids {
|
||||||
let record = self.store.get(*id).await?;
|
let record = self.store.get(*id).await;
|
||||||
|
|
||||||
|
let record = if let Ok(record) = record {
|
||||||
|
record
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
|
||||||
if record.tag != HISTORY_TAG {
|
if record.tag != HISTORY_TAG {
|
||||||
continue;
|
continue;
|
||||||
|
@ -147,6 +147,7 @@ mod tests {
|
|||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_dirs() {
|
fn test_dirs() {
|
||||||
// these tests need to be run sequentially to prevent race condition
|
// these tests need to be run sequentially to prevent race condition
|
||||||
@ -169,7 +170,9 @@ mod tests {
|
|||||||
fn test_config_dir() {
|
fn test_config_dir() {
|
||||||
env::set_var("HOME", "/home/user");
|
env::set_var("HOME", "/home/user");
|
||||||
env::remove_var("XDG_CONFIG_HOME");
|
env::remove_var("XDG_CONFIG_HOME");
|
||||||
|
|
||||||
assert_eq!(config_dir(), PathBuf::from("/home/user/.config/atuin"));
|
assert_eq!(config_dir(), PathBuf::from("/home/user/.config/atuin"));
|
||||||
|
|
||||||
env::remove_var("HOME");
|
env::remove_var("HOME");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user