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: clippy and fmt check
|
2020-02-09 22:06:13 +03:00
|
|
|
|
|
|
|
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/core-lint-fmt.yml'
|
2021-03-13 05:49:55 +03:00
|
|
|
- 'core/**'
|
|
|
|
- 'examples/**'
|
2022-02-10 23:23:10 +03:00
|
|
|
- 'tooling/cli/**'
|
2020-02-09 22:06:13 +03:00
|
|
|
|
|
|
|
jobs:
|
2020-07-06 04:13:50 +03:00
|
|
|
workspace_clippy_fmt_check:
|
2020-02-09 22:06:13 +03:00
|
|
|
runs-on: ubuntu-latest
|
2020-02-19 18:02:19 +03:00
|
|
|
|
2020-02-09 22:06:13 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install webkit2gtk
|
|
|
|
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
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Get current date
|
|
|
|
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- 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: ubuntu-latest-nightly-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-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: ubuntu-latest-nightly-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-index-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-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: ubuntu-latest-nightly-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-cargo-core-
|
|
|
|
|
2020-02-09 22:06:13 +03:00
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-30 19:50:26 +03:00
|
|
|
args: --all-targets --all-features -- -D warnings
|
2020-07-06 04:13:50 +03:00
|
|
|
name: workspace
|
2021-04-22 23:34:46 +03:00
|
|
|
|
2020-07-06 04:13:50 +03:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
2021-01-30 18:15:47 +03:00
|
|
|
cli_clippy_fmt_check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-04-22 23:34:46 +03:00
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-02-10 23:23:10 +03:00
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2021-04-22 23:34:46 +03:00
|
|
|
|
2021-01-30 18:15:47 +03:00
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2022-02-10 23:23:10 +03:00
|
|
|
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
|
2021-01-30 18:15:47 +03:00
|
|
|
name: cli
|
2021-04-22 23:34:46 +03:00
|
|
|
|
|
|
|
- name: Get current date
|
|
|
|
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
2022-02-10 23:23:10 +03:00
|
|
|
|
2021-04-22 23:34:46 +03:00
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v2.1.4
|
2021-01-30 18:15:47 +03:00
|
|
|
with:
|
2021-04-22 23:34:46 +03:00
|
|
|
path: ~/.cargo/registry
|
|
|
|
# Add date to the cache to keep it up to date
|
|
|
|
key: ubuntu-latest-nightly-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-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: ubuntu-latest-nightly-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-index-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-cargo-index-
|
|
|
|
|
|
|
|
- name: Cache CLI cargo target
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2022-02-10 23:23:10 +03:00
|
|
|
path: tooling/cli/target
|
2021-04-22 23:34:46 +03:00
|
|
|
# Add date to the cache to keep it up to date
|
2022-02-10 23:23:10 +03:00
|
|
|
key: ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
2021-04-22 23:34:46 +03:00
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
2022-02-10 23:23:10 +03:00
|
|
|
ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
2021-04-22 23:34:46 +03:00
|
|
|
ubuntu-latest-nightly-cargo-cli-
|
|
|
|
|
2021-01-30 18:15:47 +03:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
2022-02-10 23:23:10 +03:00
|
|
|
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
|
2021-01-30 18:15:47 +03:00
|
|
|
|
2020-07-06 04:13:50 +03:00
|
|
|
core_clippy_check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-02-26 04:07:30 +03:00
|
|
|
feature: [custom-protocol, api-all]
|
2020-07-06 04:13:50 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install webkit2gtk
|
|
|
|
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
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-02-10 23:23:10 +03:00
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
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: ubuntu-latest-nightly-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-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: ubuntu-latest-nightly-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-index-${{ hashFiles('**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-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: ubuntu-latest-nightly-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
|
|
|
# Restore from outdated cache for speed
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-latest-nightly-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}
|
|
|
|
ubuntu-latest-nightly-cargo-core-
|
|
|
|
|
2020-07-06 04:13:50 +03:00
|
|
|
- uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-08 19:22:20 +03:00
|
|
|
args: --manifest-path ./core/tauri/Cargo.toml --all-targets --features ${{ matrix.feature }} -- -D warnings
|
2020-07-06 04:13:50 +03:00
|
|
|
name: core
|