build(dev-deps): update all non-major dependencies #1117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
concurrency: | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
jobs: | |
webview_test: | |
name: Test Webview | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version: 20 | |
- name: Install Node.js dependencies | |
run: yarn | |
- name: Run | |
run: yarn test:unit:webview --coverage | |
- name: Upload Coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
flags: webview | |
token: ${{ secrets.CODECOV_TOKEN }} | |
core_test_debian: | |
name: Test Core (debian-latest) | |
runs-on: ubuntu-latest | |
container: | |
image: ivangabriele/tauri:debian-bullseye-18 | |
options: --security-opt seccomp=unconfined | |
env: | |
PROJECT_ROOT_PATH: /__w/clamav-desktop/clamav-desktop | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
# https://github.com/Swatinem/rust-cache#example-usage | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
key: unit_core_test_debian-latest | |
prefix-key: rust-cache | |
shared-key: v0 | |
workspaces: './src-tauri -> target' | |
- name: Install ClamAV | |
run: | | |
apt-get update | |
apt-get install -y clamav | |
- name: Print versions | |
run: | | |
cat /etc/os-release | |
rustc -V | |
cargo -V | |
clamscan -V | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version: 20 | |
- name: Install Node.js dependencies | |
run: yarn | |
- name: Build Sidecars | |
run: | | |
cd ./sidecars && cargo build --release && cd .. | |
node ./scripts/build/prepare_core_build.js | |
# https://github.com/tauri-apps/tauri/issues/3142 | |
- name: Create fake /dist directory | |
run: mkdir ./dist | |
- name: Run unit tests (with coverage) | |
run: cargo tarpaulin --frozen --no-fail-fast --out Xml --workspace -- --nocapture | |
working-directory: ./src-tauri | |
- name: Upload tests coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
directory: ./src-tauri | |
fail_ci_if_error: true | |
flags: core | |
token: ${{ secrets.CODECOV_TOKEN }} | |
core_test_macos_and_windows: | |
name: Test Core | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
PROJECT_ROOT_PATH: ${{ matrix.os == 'macos-latest' && '/Users/runner/work/clamav-desktop/clamav-desktop' || | |
'D:\a\clamav-desktop\clamav-desktop' }} | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
# https://github.com/Swatinem/rust-cache#example-usage | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
key: unit_core_test_${{ matrix.os }} | |
prefix-key: rust-cache | |
shared-key: v0 | |
workspaces: './src-tauri -> target' | |
- name: Print versions | |
run: | | |
rustc -V | |
cargo -V | |
# clamscan -V | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version: 20 | |
- name: Install Node.js dependencies | |
run: yarn | |
# https://github.com/tauri-apps/tauri/issues/3142 | |
- name: Create fake /dist directory | |
run: mkdir ./dist | |
- name: Build Sidecars | |
run: | | |
cd ./sidecars && cargo build --release && cd .. | |
node ./scripts/build/prepare_core_build.js | |
- name: Build | |
run: cargo build | |
working-directory: ./src-tauri | |
- name: Run tests | |
run: cargo test --no-fail-fast --workspace -- --nocapture | |
working-directory: ./src-tauri | |
# webview_build: | |
# name: Build Webview | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# with: | |
# submodules: false | |
# - name: Setup Node.js | |
# uses: actions/setup-node@v3 | |
# with: | |
# cache: yarn | |
# node-version: 20 | |
# - name: Install Node.js dependencies | |
# run: yarn | |
# - name: Run | |
# run: yarn build:webview | |
# - name: Upload Webview Artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: webview | |
# path: ./build | |
# core_test: | |
# name: Test Core | |
# needs: [webview_build] | |
# runs-on: ubuntu-latest | |
# container: | |
# image: ivangabriele/tauri:bullseye-18 | |
# options: --security-opt seccomp=unconfined | |
# env: | |
# CARGO_TERM_COLOR: always | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# with: | |
# submodules: false | |
# - name: Download Webview Artifact | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: webview | |
# path: ./build | |
# - name: Get Clamav Desktop version | |
# id: get_version | |
# uses: battila7/get-version-action@v2.3.0 | |
# - uses: Swatinem/rust-cache@v2 | |
# with: | |
# key: unit | |
# shared-key: ${{ steps.get_version.outputs.version }} | |
# workspaces: './src-tauri -> target' | |
# - name: Install ClamAV | |
# run: | | |
# apt-get update | |
# apt-get install -y clamav | |
# - name: Print ClamAV version | |
# run: clamscan -V | |
# - name: Build | |
# run: cargo build | |
# working-directory: ./src-tauri | |
# - name: Run | |
# run: cargo test --no-fail-fast | |
# working-directory: ./src-tauri | |
# # TODO Investigate why this is so slow. | |
# # https://github.com/xd009642/tarpaulin#github-actions | |
# - name: Generate Coverage | |
# run: cargo tarpaulin --timeout 120 --out Xml | |
# working-directory: ./src-tauri | |
# - name: Upload Coverage | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# directory: ./src-tauri |