Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rust workflow #1

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
66 changes: 66 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish to GitHub pages

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
Github-Pages-Release:
timeout-minutes: 10

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Add WASM target
run: rustup target add wasm32-unknown-unknown

- name: Clippy
run: cargo clippy -p rue-web

- name: Fmt
run: cargo fmt -- --files-with-diff --check -p rue-web

- name: Install Trunk binary
run: cargo binstall trunk

- name: Build with Trunk
run: |
cd crates/rue-web
trunk build --release --public-url "${GITHUB_REPOSITORY#*/}"

- name: Setup GitHub Pages
uses: actions/configure-pages@v4
with:
enablement: true
token:

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./crates/rue-web/dist"

- name: Deploy to GitHub Pages 🚀
id: deployment
uses: actions/deploy-pages@v3
32 changes: 32 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and test Rust code
on:
push:
branches:
- main
tags:
- "**"

pull_request:
branches:
- "**"

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Run tests
run: cargo test --all-features --workspace

- name: Clippy
run: cargo clippy --workspace

- name: Fmt
run: cargo fmt --all -- --files-with-diff --check
Loading