From eaf4c9a94c367cce1561e7584d3bc3c085b0a2a6 Mon Sep 17 00:00:00 2001 From: Ilya Sakharchuk Date: Tue, 27 Feb 2024 15:12:58 +0300 Subject: [PATCH] ci cd --- .github/workflows/cd.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..82a9d94 --- /dev/null +++ b/.github/workflows/cd.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 + + - uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: $ + publish_dir: ./dist \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2c7b473 --- /dev/null +++ b/.github/workflows/ci.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