dioxus/.github/workflows/main.yml

107 lines
2.7 KiB
YAML
Raw Normal View History

2021-12-29 04:17:36 +00:00
name: Rust CI
2022-02-10 17:05:19 +00:00
on:
push:
paths:
2022-02-10 17:08:38 +00:00
- packages/**
- examples/**
- src/**
2022-02-10 17:05:19 +00:00
- lib.rs
- Cargo.toml
2022-02-10 17:05:53 +00:00
- .github
2022-02-10 17:05:19 +00:00
pull_request:
2022-02-10 17:08:38 +00:00
branches:
- master
2022-02-10 17:05:19 +00:00
2021-12-29 04:17:36 +00:00
jobs:
check:
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-08 03:21:49 +00:00
- run: sudo apt-get update
2022-01-08 18:05:11 +00:00
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
2021-12-29 04:17:36 +00: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-08 03:21:49 +00:00
- run: sudo apt-get update
2022-02-02 23:16:56 +00:00
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
- uses: davidB/rust-cargo-make@v1
2022-02-02 23:16:56 +00:00
- uses: browser-actions/setup-firefox@latest
- uses: jetli/wasm-pack-action@v0.3.0
2022-02-04 07:47:09 +00:00
- uses: actions-rs/cargo@v1
2021-12-29 04:17:36 +00:00
with:
2022-02-01 20:34:57 +00:00
command: make
args: tests
2021-12-29 04:17:36 +00: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 14:32:53 +00: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 18:05:11 +00:00
- run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
2022-01-08 14:32:53 +00:00
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
2022-02-06 17:14:19 +00:00
coverage:
2022-02-06 22:43:33 +00:00
name: Coverage
2022-02-06 17:14:19 +00:00
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Generate code coverage
run: |
apt-get update &&\
2022-02-06 22:43:33 +00:00
apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev -y &&\
2022-02-06 22:08:26 +00:00
cargo +nightly tarpaulin --verbose --tests --all-features --workspace --timeout 120 --out Xml
2022-02-06 17:14:19 +00:00
- name: Upload to codecov.io
uses: codecov/codecov-action@v2