Skip to content

Reduce clone usage #422

Reduce clone usage

Reduce clone usage #422

Workflow file for this run

name: Code Coverage
on:
pull_request:
branches:
- "main"
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
strategy:
fail-fast: false
matrix:
info:
- { os: "macos-latest", target: "aarch64-apple-darwin", cross: false }
- {
os: "ubuntu-latest",
target: "x86_64-unknown-linux-gnu",
cross: false,
}
- {
os: "windows-latest",
target: "x86_64-pc-windows-msvc",
cross: false,
}
runs-on: ${{ matrix.info.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
targets: ${{ matrix.info.target }}
- name: Setup NodeJS toolchain
uses: actions/setup-node@v4
- name: Install TailwindCSS
run: npm install -D tailwindcss
- name: Install DaisyUI
run: npm install -D daisyui@latest
- name: Install TailwindCSS Typography
run: npm install -D @tailwindcss/typography
- name: Tauri build dependencies on Linux
if: matrix.info.os == 'ubuntu-latest'
run: sudo apt update && 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: Setup Podman user config directory
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 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: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install just runner
uses: taiki-e/install-action@just
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2.7.5
with:
save-if: false
- name: Generate code coverage (macOS)
if: matrix.info.os == 'macOS-latest'
run: sudo just _coverage
- name: Setup Rust for root (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" rustup default stable
- name: Generate code coverage (Linux)
if: matrix.info.os == 'ubuntu-latest'
run: sudo env "PATH=$PATH" just _coverage
- name: Generate code coverage (Windows)
if: matrix.info.os == 'windows-latest'
run: just --shell pwsh.exe --shell-arg -c _coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true