-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from spacedriveapp/configure-ci
Configure CI
- Loading branch information
Showing
9 changed files
with
249 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: CI | ||
|
||
on: [pull_request, merge_group] | ||
|
||
env: | ||
# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/ci.yaml | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_NET_RETRY: 10 | ||
RUST_BACKTRACE: short | ||
RUSTUP_MAX_RETRIES: 10 | ||
|
||
# Cancel previous runs of the same workflow on the same branch. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
cargo-deny: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 3 | ||
strategy: | ||
matrix: | ||
checks: | ||
- advisories | ||
- licenses sources | ||
|
||
# Prevent sudden announcement of a new advisory from failing ci: | ||
continue-on-error: ${{ matrix.checks == 'advisories' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: EmbarkStudios/cargo-deny-action@v2 | ||
with: | ||
command: check ${{ matrix.checks }} | ||
|
||
rustfmt: | ||
name: Rust Formatting | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check if files have changed | ||
uses: dorny/paths-filter@v3 | ||
continue-on-error: true | ||
id: filter | ||
with: | ||
filters: | | ||
changes: | ||
- 'src/**' | ||
- 'Cargo.toml' | ||
- 'Cargo.lock' | ||
- '.rustfmt.toml' | ||
- '.github/workflows/ci.yml' | ||
- name: Install Rust | ||
id: toolchain | ||
uses: IronCoreLabs/rust-toolchain@v1 | ||
with: | ||
components: clippy, rustfmt | ||
|
||
- name: Run rustfmt | ||
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true' | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run Clippy | ||
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true' | ||
uses: giraffate/clippy-action@v1 | ||
with: | ||
reporter: github-pr-review | ||
filter_mode: diff_context | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
clippy_flags: --workspace --all-features --locked | ||
fail_on_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
max_width = 100 | ||
hard_tabs = true | ||
newline_style = "Unix" | ||
use_small_heuristics = "Default" | ||
reorder_imports = true | ||
reorder_modules = true | ||
remove_nested_parens = true | ||
edition = "2021" | ||
merge_derives = true | ||
use_try_shorthand = false | ||
edition = "2021" | ||
force_explicit_abi = true | ||
hard_tabs = true | ||
max_width = 100 | ||
merge_derives = true | ||
newline_style = "Unix" | ||
remove_nested_parens = true | ||
reorder_imports = true | ||
reorder_modules = true | ||
use_field_init_shorthand = false | ||
force_explicit_abi = true | ||
use_small_heuristics = "Default" | ||
use_try_shorthand = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[formatting] | ||
align_comments = true | ||
align_entries = true | ||
array_auto_collapse = true | ||
array_trailing_comma = false | ||
column_width = 100 | ||
crlf = false | ||
indent_string = ' ' | ||
reorder_arrays = true | ||
reorder_keys = true | ||
trailing_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"recommendations": [ | ||
"redhat.vscode-yaml", | ||
"codezombiech.gitignore", | ||
"rust-lang.rust-analyzer", | ||
"editorconfig.editorconfig", | ||
"tamasfe.even-better-toml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"[rust]": { | ||
"editor.defaultFormatter": "rust-lang.rust-analyzer" | ||
}, | ||
"search.exclude": { | ||
"target": true | ||
}, | ||
"explorer.fileNesting.enabled": true, | ||
"explorer.fileNesting.patterns": { | ||
".env": ".env.example", | ||
"README.md": "CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md", | ||
"Cargo.toml": "Cargo.lock" | ||
}, | ||
"rust-analyzer.procMacro.enable": true, | ||
"rust-analyzer.diagnostics.experimental.enable": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,79 @@ | ||
[package] | ||
name = "sd-cloud-schema" | ||
name = "sd-cloud-schema" | ||
version = "0.1.0" | ||
authors = ["Ericson Soares <[email protected]>"] | ||
edition = "2021" | ||
license = "AGPL-3.0-only" | ||
repository = "https://github.com/spacedriveapp/cloud-services-schema" | ||
|
||
authors = ["Ericson Soares <[email protected]>"] | ||
autoexamples = false # TODO: Fix example | ||
edition = "2021" | ||
license = "AGPL-3.0-only" | ||
repository = "https://github.com/spacedriveapp/cloud-services-schema" | ||
resolver = "2" | ||
rust-version = "1.79.0" | ||
resolver = "2" | ||
|
||
[lints.rust] | ||
# Warns | ||
unused_qualifications = "warn" | ||
rust_2018_idioms = { level = "warn", priority = -1 } | ||
trivial_casts = "warn" | ||
deprecated = "warn" | ||
rust_2018_idioms = { level = "warn", priority = -1 } | ||
trivial_casts = "warn" | ||
trivial_numeric_casts = "warn" | ||
unused_allocation = "warn" | ||
deprecated = "warn" | ||
unused_allocation = "warn" | ||
unused_qualifications = "warn" | ||
# Forbids | ||
deprecated_in_future = "forbid" | ||
|
||
[lints.clippy] | ||
# Warns | ||
all = { level = "warn", priority = -1 } | ||
pedantic = { level = "warn", priority = -1 } | ||
correctness = { level = "warn", priority = -1 } | ||
perf = { level = "warn", priority = -1 } | ||
style = { level = "warn", priority = -1 } | ||
suspicious = { level = "warn", priority = -1 } | ||
complexity = { level = "warn", priority = -1 } | ||
nursery = { level = "warn", priority = -1 } | ||
unwrap_used = "warn" | ||
unnecessary_cast = "warn" | ||
cast_lossless = "warn" | ||
all = { level = "warn", priority = -1 } | ||
cast_lossless = "warn" | ||
cast_possible_truncation = "warn" | ||
cast_possible_wrap = "warn" | ||
cast_precision_loss = "warn" | ||
cast_sign_loss = "warn" | ||
dbg_macro = "warn" | ||
deprecated_cfg_attr = "warn" | ||
cast_possible_wrap = "warn" | ||
cast_precision_loss = "warn" | ||
cast_sign_loss = "warn" | ||
complexity = { level = "warn", priority = -1 } | ||
correctness = { level = "warn", priority = -1 } | ||
dbg_macro = "warn" | ||
deprecated_cfg_attr = "warn" | ||
nursery = { level = "warn", priority = -1 } | ||
pedantic = { level = "warn", priority = -1 } | ||
perf = { level = "warn", priority = -1 } | ||
separated_literal_suffix = "warn" | ||
style = { level = "warn", priority = -1 } | ||
suspicious = { level = "warn", priority = -1 } | ||
unnecessary_cast = "warn" | ||
unwrap_used = "warn" | ||
# Allows | ||
missing_errors_doc = "allow" | ||
missing_errors_doc = "allow" | ||
module_name_repetitions = "allow" | ||
|
||
|
||
[dependencies] | ||
argon2 = "0.5.3" | ||
argon2 = "0.5.3" | ||
async-stream = "0.3.5" | ||
chrono = { version = "0.4.38", default-features = false, features = ["serde"] } | ||
# Some deps still use this beta version, get rid of it when they update | ||
derive_more = { version = "1.0.0-beta.7", default-features = false, features = ["display"] } | ||
eyre = "0.6.12" | ||
chrono = { version = "0.4.38", default-features = false, features = ["serde"] } | ||
# Update blocked due to iroh-base | ||
derive_more = { version = "1.0.0-beta.7", default-features = false, features = ["display"] } | ||
eyre = "0.6.12" | ||
futures-lite = { version = "2.3.0", default-features = false, features = ["alloc"] } | ||
iroh-base = { version = "0.23.0", features = ["key"] } | ||
opaque-ke = { version = "3.0.0-pre.4", features = ["argon2"] } | ||
paste = "1.0.15" | ||
quic-rpc = { version = "0.12.0", features = ["macros"] } | ||
serde = { version = "1.0.208", features = ["derive"] } | ||
thiserror = "1.0.63" | ||
tracing = "0.1.40" | ||
url = { version = "2.5.2", features = ["serde"] } | ||
uuid = { version = "1.10.0", features = ["serde"] } | ||
zeroize = { version = "1.8.1", features = ["serde", "derive"] } | ||
iroh-base = { version = "0.23.0", features = ["key"] } | ||
opaque-ke = { version = "3.0.0-pre.4", features = ["argon2"] } | ||
paste = "1.0.15" | ||
quic-rpc = { version = "0.12.0", features = ["macros"] } | ||
serde = { version = "1.0.208", features = ["derive"] } | ||
thiserror = "1.0.63" | ||
tracing = "0.1.40" | ||
url = { version = "2.5.2", features = ["serde"] } | ||
uuid = { version = "1.10.0", features = ["serde"] } | ||
zeroize = { version = "1.8.1", features = ["derive", "serde"] } | ||
|
||
# The same rspc and specta versions used by Spacedrive's Core | ||
rspc = { git = "https://github.com/spacedriveapp/rspc.git", rev = "0018e80231", features = [ | ||
"uuid", | ||
"chrono", | ||
"tracing", | ||
"alpha", | ||
"unstable", | ||
] } | ||
# The same versions used by Spacedrive's Core | ||
# https://github.com/spacedriveapp/spacedrive/blob/0.4.2/Cargo.toml#L52 | ||
specta = { version = "=2.0.0-rc.20", features = ["chrono", "uuid"] } | ||
|
||
# The same versions used by Spacedrive's Core | ||
# https://github.com/spacedriveapp/spacedrive/blob/0.4.2/Cargo.toml#L85-L87 | ||
[dependencies.rspc] | ||
features = ["alpha", "chrono", "tracing", "unstable", "uuid"] | ||
git = "https://github.com/spacedriveapp/rspc.git" | ||
rev = "0018e80231" | ||
|
||
[dev-dependencies] | ||
tokio = { version = "1.39.3", features = ["full"] } |
Oops, something went wrong.