leptos-use/.github/workflows/ci.yml

83 lines
2.4 KiB
YAML
Raw Normal View History

2023-05-13 23:05:08 +01:00
on:
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
workflow_dispatch:
name: CI
2023-06-13 18:22:04 +01:00
permissions: write-all
2023-05-15 02:57:21 +01:00
2023-05-13 23:05:08 +01:00
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
components: rustfmt, clippy, rust-src
2023-05-13 23:05:08 +01:00
- name: Cache
uses: Swatinem/rust-cache@v2
2023-06-10 04:49:34 +01:00
- name: Check function count badge
run: python3 docs/generate_count_badge.py --check
2023-07-24 23:16:16 +01:00
- name: Check version in docs
run: python3 docs/add_version_to_docs.py --check
2023-05-13 23:05:08 +01:00
- name: Check formatting
run: cargo fmt --check
2023-07-13 11:36:38 +01:00
- name: Clippy
run: cargo clippy --features prost,serde,docs,math --tests -- -D warnings
- name: Run tests (general)
run: cargo test --features math,docs,ssr,prost,serde
- name: Run tests (axum)
run: cargo test --features math,docs,ssr,prost,serde,axum --doc use_cookie::use_cookie
- name: Run tests (actix)
run: cargo test --features math,docs,ssr,prost,serde,actix --doc use_cookie::use_cookie
2023-05-15 02:06:57 +01:00
#### mdbook
2023-05-28 18:23:10 +01:00
- name: Install mdbook I
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall,mdbook
- name: Install mdbook II
2023-05-15 02:06:57 +01:00
run: |
2023-05-28 18:29:23 +01:00
cargo binstall -y mdbook-cmdrun
2024-01-30 10:30:47 +01:00
cargo binstall -y trunk@0.17.5
2023-05-19 23:00:06 +01:00
rustup target add wasm32-unknown-unknown
2023-05-15 02:06:57 +01:00
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
2023-05-15 02:30:40 +01:00
- name: Build mdbook # TODO : run mdbook tests
2023-05-15 02:06:57 +01:00
run: |
cd docs/book
mdbook build
2023-05-19 22:28:26 +01:00
python3 post_build.py
2023-05-15 02:06:57 +01:00
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
2023-05-15 02:30:40 +01:00
path: ./docs/book/book
2023-05-15 02:06:57 +01:00
- name: Deploy book to github pages
id: deployment
uses: actions/deploy-pages@v2
##### mdbook end
2023-05-15 02:06:57 +01:00
2023-05-13 23:05:08 +01:00
- name: Publish crate leptos-use
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CRATES_TOKEN }}
2023-06-13 00:31:38 +01:00
- uses: CSchoel/release-notes-from-changelog@v1
- name: Create Release using GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release create
-d
-F RELEASE.md
-t "Version $RELEASE_VERSION"
${GITHUB_REF#refs/*/}