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 bundler
|
|
|
|
|
|
|
|
on:
|
2021-04-22 23:34:46 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
2020-07-15 14:14:11 +03:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2020-07-16 02:05:07 +03:00
|
|
|
- '.github/workflows/test-bundler.yml'
|
2021-04-12 07:59:25 +03:00
|
|
|
- 'tooling/bundler/**'
|
2020-07-15 14:14:11 +03:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-tauri-bundler:
|
|
|
|
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
|
2021-04-22 23:34:46 +03:00
|
|
|
|
2021-04-05 20:51:17 +03:00
|
|
|
- name: install webkit2gtk (ubuntu only)
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y 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 bundler cargo target
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: tooling/bundler/target
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ubuntu-latest-stable-cargo-bundler-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.platform }}-stable-cargo-bundler-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
|
|
|
${{ matrix.platform }}-stable-cargo-bundler-
|
|
|
|
|
2020-07-15 14:14:11 +03:00
|
|
|
- name: test
|
|
|
|
run: |
|
2021-04-12 07:59:25 +03:00
|
|
|
cd ./tooling/bundler
|
2020-07-15 14:14:11 +03:00
|
|
|
cargo test
|
|
|
|
|
|
|
|
clippy-fmt-check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-04-22 23:34:46 +03:00
|
|
|
- name: install minimal nightly with clippy and rustfmt
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
2021-04-05 20:51:17 +03:00
|
|
|
- name: install webkit2gtk (ubuntu only)
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y webkit2gtk-4.0
|
2020-07-15 14:14:11 +03:00
|
|
|
- name: clippy check
|
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-12 07:59:25 +03:00
|
|
|
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
|
2020-07-15 14:14:11 +03:00
|
|
|
name: bundler
|
2021-04-22 23:34:46 +03:00
|
|
|
|
2020-07-15 14:14:11 +03:00
|
|
|
- name: fmt check
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
2021-04-12 07:59:25 +03:00
|
|
|
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
|