Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,64 @@ jobs:
command: clippy
args: --all-targets -- -D warnings

lint-release:
name: Clippy on release profile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-${{ runner.os }}-${{ github.job }}-

- name: Run clippy
if: always()
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --release -- -D warnings

check-release:
name: Check release builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-${{ runner.os }}-${{ github.job }}-

- name: Run cargo check
if: always()
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets --release

check_examples:
name: Check Examples
runs-on: ubuntu-latest
Expand Down Expand Up @@ -105,7 +163,7 @@ jobs:
run: |
cd packages/yew
cargo test --doc --features "doc_test wasm_test"

- name: Run website code snippet tests
run: |
cd packages/website-test
Expand Down
21 changes: 20 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# public tasks:
# * pr-flow
# * lint
# * lint-release
# * tests
# * benchmarks
#
Expand All @@ -25,7 +26,7 @@ namespace = "core"
toolchain = "stable"
category = "Checks"
description = "Lint and test"
run_task = { name = ["lint", "tests"], fork = true }
run_task = { name = ["lint", "lint-release", "tests"], fork = true }

[tasks.lint]
category = "Checks"
Expand All @@ -50,6 +51,24 @@ private = true
workspace = true
dependencies = ["core::check-format-flow", "core::clippy-flow"]

# Needed, because we have some code differences between debug and release builds
[tasks.lint-release]
category = "Checks"
workspace = true
description = "Run cargo check and Clippy in release profile"
env = { CARGO_MAKE_CLIPPY_ARGS = "-- --deny=warnings --release" }
run_task = { name = ["check-release", "clippy-release"], fork = true }

[tasks.check-release]
private = true
command = "cargo"
args = ["check", "--all-targets", "--release"]

[tasks.clippy-release]
private = true
command = "cargo"
args = ["clippy", "--all-targets", "--release", "--", "--deny=warnings"]

[tasks.tests-setup]
private = true
script_runner = "@duckscript"
Expand Down
Loading