You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tauri-plugins-workspace/.github/workflows/test-rust.yml

82 lines
2.2 KiB

name: Test Rust
on:
push:
branches:
- v1
- v2
paths:
- ".github/workflows/test-rust.yml"
- "plugins/*/src/**"
- "**/Cargo.toml"
- "**/Cargo.lock"
pull_request:
branches:
- v1
- v2
paths:
- ".github/workflows/test-rust.yml"
- "plugins/*/src/**"
- "**/Cargo.toml"
- "**/Cargo.lock"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
packages: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v2
id: changes
with:
filters: .github/filters.yaml
test:
needs: changes
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: install webkit2gtk and libudev for [authenticator]
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
- uses: dtolnay/rust-toolchain@1.65.0
- uses: Swatinem/rust-cache@v2
- name: create dummy dist
working-directory: examples/api
run: mkdir dist
- name: test ${{ package }}
if: matrix.package != 'tauri-plugin-sql'
run: cargo test --package ${{ matrix.package }} --all-targets
- name: test ${{ package }} --all-features
if: ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-webspcket", "tauri-plugin-sql"]', matrix.package)) }}
run: cargo test --package ${{ matrix.package }} --all-targets --all-features
- name: test ${{ package }} mysql
if: matrix.package == 'tauri-plugin-sql'
run: cargo test --package ${{ matrix.package }} --all-targets --features mysql
- name: test ${{ package }} postgres
if: matrix.package == 'tauri-plugin-sql'
run: cargo test --package ${{ matrix.package }} --all-targets --features postgres