From 5be4bbdf57cacb0fe18e72b2d872adc5a1f6f5f6 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Fri, 19 May 2023 11:03:02 -0300 Subject: [PATCH] feat(ci): test mobile targets --- .github/workflows/test-rust.yml | 45 ++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml index 66254085..195fe868 100644 --- a/.github/workflows/test-rust.yml +++ b/.github/workflows/test-rust.yml @@ -126,26 +126,37 @@ jobs: fail-fast: false matrix: package: ${{ fromJSON(needs.changes.outputs.packages) }} - platform: [ubuntu-latest, macos-latest, windows-latest] + platform: + - { target: x86_64-pc-windows-msvc, os: windows-latest, cross: false } + - { + target: x86_64-unknown-linux-gnu, + os: ubuntu-latest, + cross: false, + } + - { target: x86_64-apple-darwin, os: macos-latest, cross: false } + - { target: aarch64-apple-ios, os: macos-latest, cross: false } + - { target: aarch64-linux-android, os: ubuntu-latest, cross: true } - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform.os }} steps: - uses: actions/checkout@v3 - name: install webkit2gtk and libudev for [authenticator] - if: matrix.platform == 'ubuntu-latest' + if: contains(matrix.platform.target, 'unknown-linux') run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev - name: install openssl - if: ${{ matrix.platform == 'windows-latest' && contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-authenticator"]'), matrix.package) }} + if: ${{ matrix.platform.os == 'windows-latest' && contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-authenticator"]'), matrix.package) }} run: | echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append vcpkg install openssl:x64-windows-static-md - uses: dtolnay/rust-toolchain@1.65.0 + with: + targets: ${{ matrix.platform.target }} - uses: Swatinem/rust-cache@v2 @@ -155,16 +166,32 @@ jobs: - name: test ${{ matrix.package }} if: matrix.package != 'tauri-plugin-sql' - run: cargo test --package ${{ matrix.package }} --all-targets + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.platform.cross }} + command: test + args: --package ${{ matrix.package }} --all-targets - - name: test ${{ matrix.package }} --all-features + - name: test ${{ matrix.package }} if: ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-sql"]'), matrix.package) }} - run: cargo test --package ${{ matrix.package }} --all-targets --all-features + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.platform.cross }} + command: test + args: --package ${{ matrix.package }} --all-targets --all-features - name: test ${{ matrix.package }} mysql if: matrix.package == 'tauri-plugin-sql' - run: cargo test --package ${{ matrix.package }} --all-targets --no-default-features --features mysql + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.platform.cross }} + command: test + args: --package ${{ matrix.package }} --all-targets --all-features --features mysql - name: test ${{ matrix.package }} postgres if: matrix.package == 'tauri-plugin-sql' - run: cargo test --package ${{ matrix.package }} --all-targets --no-default-features --features postgres + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.platform.cross }} + command: test + args: --package ${{ matrix.package }} --all-targets --all-features --features postgres