diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..5942ec9 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -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 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..044c77d --- /dev/null +++ b/.github/workflows/rust.yml @@ -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