Skip to content

Commit

Permalink
Adds basic error crate and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Tpt committed Nov 25, 2024
1 parent b738f6b commit 53d62f3
Show file tree
Hide file tree
Showing 8 changed files with 434 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: ci

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "12 3 * * *"

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup component add rustfmt
- run: cargo fmt --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings -D clippy::all
- run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::all

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo test
- run: cargo test --all-features

test_msv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup override set 1.75.0 && rustup toolchain install nightly
- uses: Swatinem/rust-cache@v2
- run: rm Cargo.lock
- run: cargo +nightly update -Z direct-minimal-versions
- run: cargo test
- run: cargo test --all-features

rustdoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo doc --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings

deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with: { tool: cargo-deny }
- run: cargo deny check

semver_checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with: { tool: cargo-semver-checks }
# TODO: enable after first release - run: cargo semver-checks check-release || true

typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with: { tool: typos-cli }
- run: typos
65 changes: 65 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[workspace]
members = []
members = ["error"]
resolver = "2"

[workspace.package]
edition = "2021"
version = "0.0.0"
license = "Apache-2.0"
rust-version = "1.75"

[workspace.dependencies]
serde = "1"
8 changes: 8 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[licenses]
allow = [
"Apache-2.0",
"MIT",
]

[sources]
unknown-registry = "deny"
9 changes: 9 additions & 0 deletions error/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "twurst-error"
description = "Twirp error struct"
edition.workspace = true
version.workspace = true
license.workspace = true

[dependencies]
serde = { workspace = true, features = ["derive"], optional = true }
12 changes: 12 additions & 0 deletions error/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Small library implementing the `TwirpError` struct.
Please don't use it directly but rely on `twurst-client` or `twurst-server`that re-export this type.

## License

Copyright 2024 Helsing GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
Loading

0 comments on commit 53d62f3

Please sign in to comment.