dioxus/.github/workflows/main.yml

111 lines
2.9 KiB
YAML
Raw Normal View History

2021-12-28 23:17:36 -05:00
name: Rust CI
2022-02-10 12:05:19 -05:00
on:
push:
paths:
2022-02-10 12:08:38 -05:00
- packages/**
- examples/**
- src/**
2022-02-10 12:08:52 -05:00
- .github/**
2022-02-10 12:05:19 -05:00
- lib.rs
- Cargo.toml
pull_request:
2022-02-13 12:40:25 -05:00
types: [opened, synchronize, reopened, ready_for_review]
2022-02-10 12:08:38 -05:00
branches:
- master
2022-02-10 12:05:19 -05:00
2021-12-28 23:17:36 -05:00
jobs:
check:
2022-02-13 12:41:38 -05:00
if: github.event.pull_request.draft == false
2021-12-28 23:17:36 -05:00
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
2022-01-07 22:21:49 -05:00
- run: sudo apt-get update
2022-01-08 19:05:11 +01:00
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
2021-12-28 23:17:36 -05:00
- uses: actions-rs/cargo@v1
with:
command: check
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
2022-01-07 22:21:49 -05:00
- run: sudo apt-get update
2022-02-03 00:16:56 +01:00
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
- uses: davidB/rust-cargo-make@v1
2022-02-03 00:16:56 +01:00
- uses: browser-actions/setup-firefox@latest
- uses: jetli/wasm-pack-action@v0.3.0
2022-02-04 08:47:09 +01:00
- uses: actions-rs/cargo@v1
2021-12-28 23:17:36 -05:00
with:
2022-02-01 21:34:57 +01:00
command: make
args: tests
2021-12-28 23:17:36 -05:00
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
2022-01-08 15:32:53 +01:00
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- run: sudo apt-get update
2022-01-08 19:05:11 +01:00
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
2022-01-08 15:32:53 +01:00
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
2022-02-06 18:14:19 +01:00
coverage:
2022-02-06 23:43:33 +01:00
name: Coverage
2022-02-06 18:14:19 +01:00
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
2022-02-11 22:01:22 +01:00
- name: Checkout repository
2022-02-12 00:11:33 +01:00
uses: actions/checkout@v2
2022-02-11 22:01:22 +01:00
- name: Generate code coverage
2022-02-12 00:11:33 +01:00
run: |
apt-get update &&\
apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev -y &&\
cargo +nightly tarpaulin --verbose --tests --all-features --workspace --timeout 120 --out Xml
2022-02-11 22:01:22 +01:00
- name: Upload to codecov.io
2022-02-12 00:11:33 +01:00
uses: codecov/codecov-action@v2
2022-02-11 21:58:44 +01:00
with:
fail_ci_if_error: false