fix(dev-deps): enforce ws to v>=8.17.1 [security] #1073
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 | |
jobs: | |
webview_test: | |
name: Test Webview | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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: true | |
# 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 | |
# 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: | |
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: true | |
# 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' | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Print versions | |
run: | | |
rustc -V | |
cargo -V | |
# clamscan -V | |
# https://github.com/tauri-apps/tauri/issues/3142 | |
- name: Create fake /dist directory | |
run: mkdir ./dist | |
- 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 | |
# needs: | |
# - webview_lint | |
# - webview_type | |
# - webview_test | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - 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 | |
# - 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 |