-
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.
- Loading branch information
0 parents
commit 46cbdb9
Showing
18 changed files
with
3,730 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: "ci" | ||
|
||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: "chore(crates)" |
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,30 @@ | ||
name: "Auto-merge Dependabot" | ||
|
||
on: "pull_request" | ||
|
||
jobs: | ||
automerge: | ||
name: "Check and merge PR" | ||
|
||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
permissions: | ||
contents: "write" | ||
pull-requests: "write" | ||
|
||
steps: | ||
- name: "Fetch metadata" | ||
uses: "dependabot/fetch-metadata@v2" | ||
id: "metadata" | ||
with: | ||
github-token: ${{ github.token }} | ||
|
||
- name: "Enable auto-merge" | ||
if: ${{ contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.metadata.outputs.update-type) }} | ||
run: | | ||
gh pr merge --auto --squash "$PR" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
PR: ${{ github.event.pull_request.html_url }} |
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,131 @@ | ||
name: "CI" | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- "**.rs" | ||
- "Cargo.toml" | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- "Cargo.toml" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
msrv: | ||
name: "Read MSRV" | ||
uses: "actions-rust-lang/msrv/.github/workflows/msrv.yml@v0" | ||
|
||
build: | ||
name: "Build" | ||
needs: ["msrv"] | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust-version: | ||
# Latest nightly | ||
- "nightly" | ||
# Latest stable | ||
- "stable" | ||
# MSRV | ||
- ${{ needs.msrv.outputs.msrv }} | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Install Rust" | ||
uses: "actions-rust-lang/setup-rust-toolchain@v1" | ||
with: | ||
toolchain: ${{ matrix.rust-version }} | ||
|
||
- name: "Run build" | ||
run: | | ||
cargo build | ||
documentation: | ||
name: "Documentation" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Install Rust" | ||
uses: "actions-rust-lang/setup-rust-toolchain@v1" | ||
|
||
- name: "Generate docs" | ||
env: | ||
RUSTDOCFLAGS: "-Dwarnings" | ||
run: | | ||
cargo rustdoc | ||
rustfmt: | ||
name: "Rustfmt" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Rust" | ||
uses: "actions-rust-lang/setup-rust-toolchain@v1" | ||
with: | ||
components: "rustfmt" | ||
|
||
- name: "Run rustfmt" | ||
uses: "actions-rust-lang/rustfmt@v1" | ||
|
||
test: | ||
name: "Test" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Rust" | ||
uses: "actions-rust-lang/setup-rust-toolchain@v1" | ||
with: | ||
components: "rustfmt" | ||
|
||
- name: "Run tests" | ||
run: | | ||
cargo test | ||
typos: | ||
name: "Typos" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Check for typos" | ||
uses: "crate-ci/typos@v1" | ||
|
||
release-gate: | ||
name: "CI Release gate" | ||
needs: | ||
- "build" | ||
- "documentation" | ||
- "rustfmt" | ||
- "test" | ||
- "typos" | ||
|
||
if: ${{ always() }} | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Exit with error" | ||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | ||
run: exit 1 |
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,52 @@ | ||
name: "Clippy" | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- "**.rs" | ||
- "Cargo.toml" | ||
- "Cargo.lock" | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- "Cargo.toml" | ||
- "Cargo.lock" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
clippy: | ||
name: "Run scan" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
permissions: | ||
security-events: "write" | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Rust" | ||
uses: "actions-rust-lang/setup-rust-toolchain@v1" | ||
with: | ||
components: "clippy" | ||
|
||
- name: "Install sarif tools" | ||
run: | | ||
cargo install clippy-sarif sarif-fmt | ||
- name: "Run clippy" | ||
run: | | ||
cargo clippy \ | ||
--all-features \ | ||
--all-targets \ | ||
--tests \ | ||
--message-format=json \ | ||
| clippy-sarif | tee /tmp/clippy-result | sarif-fmt | ||
- name: "Upload results" | ||
uses: "github/codeql-action/upload-sarif@v3" | ||
with: | ||
sarif_file: "/tmp/clippy-result" | ||
wait-for-processing: 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
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 @@ | ||
hard_tabs = 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,45 @@ | ||
[package] | ||
name = "modrinth-api" | ||
version = "0.1.0" | ||
authors = [ | ||
"Seth <getchoo at tuta dot io>", | ||
"SkywardMC Contributors" | ||
] | ||
edition = "2021" | ||
rust-version = "1.78" | ||
description = "Structured bindings for Modrinth's API" | ||
readme = "README.md" | ||
repository = "https://github.com/skywardmc/modrinth-api" | ||
license = "MPL-2.0" | ||
keywords = ["minecraft", "modrinth", "api", "binding"] | ||
categories = ["api-bindings"] | ||
exclude = [ | ||
"/.github", | ||
"/.gitignore", | ||
"**.nix", | ||
"flake.lock" | ||
] | ||
|
||
# TODO: publish :) | ||
publish = false | ||
|
||
[dependencies] | ||
serde = { version = "1.0", features = ["derive"] } | ||
|
||
[dev-dependencies] | ||
serde_json = "1.0" | ||
|
||
[lints.clippy] | ||
cargo = "warn" | ||
complexity = "warn" | ||
correctness = "deny" | ||
pedantic = "warn" | ||
perf = "warn" | ||
style = "warn" | ||
suspicious = "deny" | ||
|
||
[lints.rust] | ||
unsafe_code = "forbid" | ||
|
||
[package.metadata.typos] | ||
files.extend-exclude = ["tests/**"] |
Oops, something went wrong.