Skip to content

Commit

Permalink
chore(ci): add gitignore and CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin committed Mar 22, 2024
1 parent ead8b70 commit 0500010
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Install wasm Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
target: wasm32-unknown-unknown

- name: Run clippy for native
run: cargo clippy --all-targets --all-features -- -D warnings -D missing-docs

- name: Run clippy for wasm32
run: cargo clippy --all-targets --all-features --target=wasm32-unknown-unknown -- -D warnings -D missing-docs


docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Run rustdoc check
env:
RUSTDOCFLAGS: --cfg docs_rs -D warnings
run: cargo +nightly doc


fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run fmt
run: cargo fmt -- --check


test-wasm:
runs-on: ubuntu-latest
env:
WASM_BINDGEN_TEST_TIMEOUT: 60
steps:
- uses: actions/checkout@v1

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown

- name: Install wasm-pack
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: [email protected]

- name: Install chromedriver # we don't specify chrome version to match whatever's installed
uses: nanasess/setup-chromedriver@v2

- name: Build (wasm32-unknown-unknown)
run: cargo build --target=wasm32-unknown-unknown --all-features

- name: Run tests
run: wasm-pack test --headless --chrome --all-features


test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Set up cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys:
cargo-${{ hashFiles('**/Cargo.lock') }}
cargo-

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


unused-deps:
runs-on: ubuntu-latest
name: unused dependencies
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-udeps
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: [email protected]

- name: Check for unused dependencies
run: cargo +nightly udeps --all-features --all-targets
30 changes: 30 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- main

jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Run release-plz
uses: MarcoIeni/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target

0 comments on commit 0500010

Please sign in to comment.