From a06fa36ec69ee12e3da08f8de18d690f3ee2c99c Mon Sep 17 00:00:00 2001 From: Bas Zalmstra Date: Tue, 30 Jul 2024 11:12:01 +0200 Subject: [PATCH] initial commit --- .github/dependabot.yml | 19 ++++++++ .github/workflows/rust-compile.yml | 72 ++++++++++++++++++++++++++++++ .gitignore | 30 +++++++++++++ Cargo.toml | 2 + 4 files changed, 123 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/rust-compile.yml create mode 100644 .gitignore create mode 100644 Cargo.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ff15d8f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "dependencies" + commit-message: + prefix: "chore(ci)" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + labels: + - "dependencies" + commit-message: + prefix: "bump" + open-pull-requests-limit: 10 diff --git a/.github/workflows/rust-compile.yml b/.github/workflows/rust-compile.yml new file mode 100644 index 0000000..f3a5173 --- /dev/null +++ b/.github/workflows/rust-compile.yml @@ -0,0 +1,72 @@ +on: + push: + branches: + - "main" + pull_request: + +name: Rust + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_LOG: info + RUST_BACKTRACE: 1 + RUSTFLAGS: "-D warnings" + CARGO_TERM_COLOR: always + +jobs: + check-rustdoc-links: + name: Check intra-doc links + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: | + for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do + cargo rustdoc -p "$package" --all-features -- -D warnings -W unreachable-pub + done + + format_and_lint: + name: Format and Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy, rustfmt + - name: Run rustfmt + uses: actions-rust-lang/rustfmt@v1 + - name: Run clippy + run: cargo clippy --all-targets + + test: + name: Test + runs-on: ubuntu-latest + needs: [ format_and_lint ] + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + cache: false + + - name: Install cargo nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - name: Run tests + run: > + cargo nextest run --workspace + + - name: Run doctests + run: > + cargo test --doc + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e6de59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +.idea/ + +.vscode/ + +# Generated by Cargo +# will have compiled files and executables +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 + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +**/.DS_Store + +# rattler +.prefix + +# pixi +.pixi/ +pixi.lock + +# Visual studio files +.vs/ diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c66a4d7 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["crates/*"]