Updated dependencies to yew 0.21 and gloo 0.10 #328
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Run Tests & Publishing | |
on: [push, pull_request] | |
jobs: | |
lint: | |
name: Lint Codebase | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
- name: Restore Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Run Lints | |
run: cargo make lints | |
build: | |
name: Build Examples | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
- name: Restore Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Setup trunk | |
uses: jetli/trunk-action@v0.4.0 | |
with: | |
version: "latest" | |
- name: Build Examples | |
run: | | |
for d in "examples/"* | |
do | |
trunk build --release $d/index.html | |
done | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
services: | |
httpbin: | |
image: kennethreitz/httpbin | |
ports: | |
- 8080:80 | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
- name: Restore Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Run Tests | |
run: cargo make tests | |
publish: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
- build | |
- test | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
- name: Restore Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo publish --dry-run for bounce-macros | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: cargo publish --dry-run --manifest-path crates/bounce-macros/Cargo.toml | |
env: | |
RUSTFLAGS: "--cfg releasing" | |
- name: Run cargo publish for bounce-macros | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --manifest-path crates/bounce-macros/Cargo.toml | |
env: | |
RUSTFLAGS: "--cfg releasing" | |
# Not possible if bounce-macros does not have a compatible version on crates.io | |
# See: https://github.com/rust-lang/cargo/issues/1169 | |
# - name: Run cargo publish --dry-run for bounce | |
# if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
# run: cargo publish --dry-run --manifest-path crates/bounce/Cargo.toml | |
# env: | |
# RUSTFLAGS: "--cfg releasing" | |
- name: Run cargo publish for bounce | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --manifest-path crates/bounce/Cargo.toml | |
env: | |
RUSTFLAGS: "--cfg releasing" |