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
|
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/**'
|
2021-04-21 21:42:52 +03:00
|
|
|
- 'tooling/**'
|
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:
|
2019-12-21 12:47:33 +03:00
|
|
|
build-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-05-06 18:57:08 +03:00
|
|
|
sudo apt-get install -y libgtk-3-dev libgtksourceview-3.0-dev webkit2gtk-4.0
|
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
|
2019-11-02 11:36:15 +03:00
|
|
|
|
2021-01-30 18:15:47 +03:00
|
|
|
test-tauri-cli:
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
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 CLI cargo target
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: tooling/cli.rs/target
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.platform }}-stable-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}
|
|
|
|
${{ matrix.platform }}-stable-cargo-cli-
|
|
|
|
|
2021-01-30 18:15:47 +03:00
|
|
|
- name: build CLI
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2021-04-12 07:59:25 +03:00
|
|
|
args: --manifest-path ./tooling/cli.rs/Cargo.toml
|
2021-01-30 18:15:47 +03:00
|
|
|
|
2019-12-21 12:47:33 +03:00
|
|
|
test-tauri-js-cli:
|
2019-11-02 11:36:15 +03:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
|
|
|
|
steps:
|
2020-01-14 16:55:39 +03:00
|
|
|
- uses: actions/checkout@v2
|
2020-03-07 19:40:24 +03:00
|
|
|
- name: install webkit2gtk (ubuntu only)
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-05-06 18:57:08 +03:00
|
|
|
sudo apt-get install -y libgtk-3-dev libgtksourceview-3.0-dev webkit2gtk-4.0
|
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 CLI cargo target
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: tooling/cli.rs/target
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.platform }}-stable-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}
|
|
|
|
${{ matrix.platform }}-stable-cargo-cli-
|
|
|
|
|
2020-01-14 16:55:39 +03:00
|
|
|
- name: test
|
2021-01-30 18:15:47 +03:00
|
|
|
timeout-minutes: 30
|
2020-01-14 16:55:39 +03:00
|
|
|
run: |
|
2021-04-12 07:59:25 +03:00
|
|
|
cd ./tooling/cli.js
|
2020-01-14 16:55:39 +03:00
|
|
|
yarn
|
|
|
|
yarn test
|
2020-11-13 11:27:42 +03:00
|
|
|
- name: run release build
|
|
|
|
timeout-minutes: 15
|
2021-04-12 07:59:25 +03:00
|
|
|
working-directory: tooling/cli.js
|
2020-11-13 11:27:42 +03:00
|
|
|
run: yarn build-release
|