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