Skip to content

Commit

Permalink
Merge pull request #1 from virto-network/feat/workspace-and-pass-crate
Browse files Browse the repository at this point in the history
feat: add cargo workpaces + add `pass-webauthn`
  • Loading branch information
olanod authored Oct 15, 2024
2 parents bb34b85 + 99b86b8 commit b3daae7
Show file tree
Hide file tree
Showing 17 changed files with 5,287 additions and 111 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Lint, check, clippy and test

on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check formatting
run: cargo fmt --all -- --check

check:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/[email protected]
with:
cache-on-failure: true
cache-all-crates: true
key: check

- name: Check Build
run: |
cargo check --release --locked --all-features --workspace
clippy:
needs: lint
runs-on: ubuntu-latest
permissions:
checks: write
env:
SKIP_WASM_BUILD: 1
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/[email protected]
with:
cache-on-failure: true
cache-all-crates: true
key: check

- name: Annotate with Clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --release --locked --all-features --workspace

test:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/[email protected]
with:
cache-on-failure: true
cache-all-crates: true
key: test

- name: Run tests
run: cargo test --release --locked --all-features --workspace
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
lint:
name: Validate PR title for conventional commit compliance
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
Loading

0 comments on commit b3daae7

Please sign in to comment.