From 88a52f5ad227d3451e0b042d197014b095d6ada7 Mon Sep 17 00:00:00 2001 From: ojyrkinen Date: Fri, 24 Nov 2023 14:09:16 +0100 Subject: [PATCH] Added CI/CD workflows --- .github/workflows/continuous_deployment.yml | 28 ++++++++++++++++++++ .github/workflows/continuous_integration.yml | 24 +++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/continuous_deployment.yml create mode 100644 .github/workflows/continuous_integration.yml diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml new file mode 100644 index 00000000..8b72a98a --- /dev/null +++ b/.github/workflows/continuous_deployment.yml @@ -0,0 +1,28 @@ +name: Continuous deployment +on: + workflow_run: + branches: [main] + workflows: [Continuous integration] + types: [completed] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + + - uses: jetli/trunk-action@v0.1.0 + - uses: jetli/wasm-bindgen-action@v0.1.0 + + - uses: actions/checkout@v2 + + - run: trunk build --release --public-url /${{ github.event.repository.name }}/ + + - uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist \ No newline at end of file diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml new file mode 100644 index 00000000..ed0a8748 --- /dev/null +++ b/.github/workflows/continuous_integration.yml @@ -0,0 +1,24 @@ +name: Continuous integration +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: cargo test --all + + format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: cargo fmt --all -- --check + + clippy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: cargo clippy --all -- -D warnings \ No newline at end of file