Skip to content

Commit

Permalink
only run tests on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
puffyCid committed Dec 4, 2024
1 parent 1b4dc6b commit 3ce7276
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 56 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,19 @@ jobs:
- name: Tauri build dependencies on Linux
if: matrix.info.os == 'ubuntu-latest'
run: sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install Docker and Colima on macOS
if: matrix.info.os == 'macos-latest'
run: brew install docker colima && colima start

- name: Install Podman on Windows
if: matrix.info.os == 'windows-latest'
run: mkdir -p ~/.ssh && choco install -y podman-cli && podman.exe machine init && podman.exe machine start

- name: Setup Podman user config directory
if: matrix.info.os != 'windows-latest'
if: matrix.info.os == 'ubuntu-latest'
run: mkdir -p ~/.config/containers

- name: Register docker.io for Podman
if: matrix.info.os == 'ubuntu-latest'
run: echo "unqualified-search-registries = ['docker.io']" > ~/.config/containers/registries.conf

- name: Download OpenSearch on Windows
if: matrix.info.os == 'windows-latest'
run: podman.exe run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Download OpenSearch on Linux
if: matrix.info.os == 'ubuntu-latest'
run: podman run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Download OpenSearch on macOS
if: matrix.info.os == 'macos-latest'
run: docker run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Install trunk
uses: jetli/trunk-action@v0.5.0
with:
Expand Down
30 changes: 9 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,13 @@ jobs:
if: matrix.info.os == 'ubuntu-latest'
run: sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install Docker and Colima on macOS
if: matrix.info.os == 'macos-latest'
run: brew install docker colima && colima start

- name: Install Podman on Windows
if: matrix.info.os == 'windows-latest'
run: mkdir -p ~/.ssh && choco install -y podman-cli && podman.exe machine init && podman.exe machine start

- name: Setup Podman user config directory
if: matrix.info.os != 'windows-latest'
if: matrix.info.os == 'ubuntu-latest'
run: mkdir -p ~/.config/containers

- name: Register docker.io for Podman
run: echo "unqualified-search-registries = ['docker.io']" > ~/.config/containers/registries.conf

- name: Download OpenSearch on Windows
if: matrix.info.os == 'windows-latest'
run: podman.exe run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Download OpenSearch on Linux
if: matrix.info.os == 'ubuntu-latest'
run: podman run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Download OpenSearch on macOS
if: matrix.info.os == 'macos-latest'
run: docker run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest
run: echo "unqualified-search-registries = ['docker.io']" > ~/.config/containers/registries.conf

- name: Fmt Check
run: cargo fmt -- --check
Expand All @@ -108,16 +89,23 @@ jobs:
- name: Setup Rust for root (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" rustup default stable && sudo env "PATH=$PATH" rustup target add wasm32-unknown-unknown

- name: Build tests (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" cargo test --no-run --release

- name: Download OpenSearch on Linux
if: matrix.info.os == 'ubuntu-latest'
run: podman run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Run tests (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" cargo test --release

- name: Build tests (Windows)
if: matrix.info.os == 'windows-latest'
run: cargo test --no-run --release

- name: Run tests (Windows)
if: matrix.info.os == 'windows-latest'
run: cargo test --release
27 changes: 10 additions & 17 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,14 @@ jobs:
if: matrix.info.os == 'ubuntu-latest'
run: sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev

- name: Install Podman on Windows
if: matrix.info.os == 'windows-latest'
run: mkdir -p ~/.ssh && choco install -y podman-cli && podman.exe machine init && podman.exe machine start

- name: Setup Podman user config directory
if: matrix.info.os != 'windows-latest'
if: matrix.info.os == 'ubuntu-latest'
run: mkdir -p ~/.config/containers

- name: Register docker.io for Podman
if: matrix.info.os == 'ubuntu-latest'
run: echo "unqualified-search-registries = ['docker.io']" > ~/.config/containers/registries.conf

- name: Download OpenSearch on Windows
if: matrix.info.os == 'windows-latest'
run: podman.exe run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Download OpenSearch on Linux
if: matrix.info.os == 'ubuntu-latest'
run: podman run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Download OpenSearch on macOS
if: matrix.info.os == 'macos-latest'
run: export OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" && brew install opensearch && brew services start opensearch

- name: Enable Rust cache
uses: Swatinem/rust-cache@v2.7.3
with:
Expand All @@ -97,23 +82,31 @@ jobs:
- name: Build tests (macOS)
if: matrix.info.os == 'macOS-latest'
run: sudo cargo test --no-run --release

- name: Run tests (macOS)
if: matrix.info.os == 'macOS-latest'
run: sudo cargo test --release

- name: Setup Rust for root (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" rustup default stable && sudo env "PATH=$PATH" rustup target add wasm32-unknown-unknown

- name: Build tests (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" cargo test --no-run --release

- name: Download OpenSearch on Linux
if: matrix.info.os == 'ubuntu-latest'
run: podman run -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="Ughsocomplex123567890!" -e "discovery.type=single-node" --name opensearch-node -d opensearchproject/opensearch:latest

- name: Run tests (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" cargo test --release

- name: Build tests (Windows)
if: matrix.info.os == 'windows-latest'
run: cargo test --no-run --release

- name: Run tests (Windows)
if: matrix.info.os == 'windows-latest'
run: cargo test --release
1 change: 1 addition & 0 deletions apollo/src-tauri/src/about/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub(crate) async fn metadata() -> Result<Value, ()> {
}

#[cfg(test)]
#[cfg(target_os = "linux")]
mod tests {
use super::{about_me, metadata};

Expand Down
1 change: 1 addition & 0 deletions apollo/src-tauri/src/search/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pub(crate) fn setup_client() -> Result<OpenSearch, Error> {
}

#[cfg(test)]
#[cfg(target_os = "linux")]
mod tests {
use crate::search::index::{create_index, delete_index, upload_data, upload_metadata};
use opensearch::{BulkOperation, BulkOperations};
Expand Down
1 change: 1 addition & 0 deletions apollo/src-tauri/src/search/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub(crate) async fn check_response(res: Response) -> Value {
}

#[cfg(test)]
#[cfg(target_os = "linux")]
mod tests {
use crate::search::query::{
artifacts, get_metadata, get_resources, list_indexes, timeline, QueryState,
Expand Down
1 change: 1 addition & 0 deletions apollo/src-tauri/src/timeline/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub(crate) async fn list_artifacts(index: &str) -> Result<Value, ()> {
}

#[cfg(test)]
#[cfg(target_os = "linux")]
mod tests {
use crate::{
search::query::QueryState,
Expand Down
2 changes: 1 addition & 1 deletion core/src/artifacts/os/windows/outlook/blocks/xblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn xblock_data<'a>(
}
}
}
return extract_xblock_entries(data, format);
extract_xblock_entries(data, format)
}

/// Extract xblock and xxblock entries
Expand Down

0 comments on commit 3ce7276

Please sign in to comment.