2021-04-11 01:09:09 +03:00
|
|
|
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2020-07-15 14:14:11 +03:00
|
|
|
name: test core
|
|
|
|
|
|
|
|
on:
|
2021-04-22 23:34:46 +03:00
|
|
|
push:
|
|
|
|
branches:
|
2021-04-23 21:34:38 +03:00
|
|
|
- dev
|
2021-10-02 22:15:50 +03:00
|
|
|
- next
|
2020-07-15 14:14:11 +03:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2020-07-16 02:05:07 +03:00
|
|
|
- '.github/workflows/test-core.yml'
|
2021-03-13 05:49:55 +03:00
|
|
|
- 'core/**'
|
|
|
|
- 'examples/**'
|
2022-02-14 00:21:15 +03:00
|
|
|
- 'tooling/cli/**'
|
2019-11-02 11:36:15 +03:00
|
|
|
|
2020-06-17 22:30:41 +03:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
2019-11-02 11:36:15 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-11-05 17:01:31 +03:00
|
|
|
test-tauri-core:
|
2019-11-02 11:36:15 +03:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2019-12-01 15:26:28 +03:00
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
2019-11-02 11:36:15 +03:00
|
|
|
|
|
|
|
steps:
|
2020-01-14 16:55:39 +03:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-11-16 23:24:24 +03:00
|
|
|
toolchain: stable
|
2020-01-14 16:55:39 +03:00
|
|
|
- name: install webkit2gtk (ubuntu only)
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-08-15 23:09:55 +03:00
|
|
|
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
|
2021-04-22 23:34:46 +03:00
|
|
|
|
|
|
|
- name: Get current date
|
|
|
|
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
|
|
|
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
|
|
|
|
|
|
|
- name: Get current date
|
|
|
|
if: matrix.platform == 'windows-latest'
|
|
|
|
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
|
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v2.1.4
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
${{ matrix.platform }}-stable-cargo-registry-
|
|
|
|
|
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v2.1.4
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
${{ matrix.platform }}-stable-cargo-index-
|
|
|
|
|
|
|
|
- name: Cache core cargo target
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}
|
|
|
|
${{ matrix.platform }}-stable-cargo-core-
|
|
|
|
|
2020-01-15 06:03:59 +03:00
|
|
|
- name: test
|
|
|
|
run: |
|
2020-02-06 04:18:47 +03:00
|
|
|
cargo test
|
2021-11-05 17:01:31 +03:00
|
|
|
cargo test --features api-all
|
2022-02-04 21:17:08 +03:00
|
|
|
cargo test --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray
|