Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
Language: Cpp
BasedOnStyle: LLVM

# 4 spaces everywhere
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4

# Modern C++ style
Standard: c++20
ColumnLimit: 120
PointerAlignment: Left

# Organize includes
SortIncludes: true
IncludeBlocks: Regroup
15 changes: 15 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
If:
PathMatch: (^|.*/)crates/bender-slang/cpp/.*\.(h|hpp|hh|c|cc|cpp|cxx)$
CompileFlags:
Add:
- -std=c++20
- -fno-cxx-modules
- -I.
- -I../../../crates
- -I../vendor/slang/include
- -I../vendor/slang/external
- -I../../../target/slang-generated-include
- -I../../../target/cxxbridge
- -DSLANG_USE_MIMALLOC=1
- -DSLANG_USE_THREADS=1
- -DSLANG_BOOST_SINGLE_HEADER=1
58 changes: 0 additions & 58 deletions .github/scripts/gen_dockerfile.sh

This file was deleted.

52 changes: 48 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -26,13 +29,14 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust}}
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-test-${{ runner.os }}-${{ matrix.rust }}
cache-workspace-crates: "true"
- name: Build
run: cargo build --all-features
- name: Cargo Test
run: cargo test --workspace --all-features
- name: Format (fix with `cargo fmt`)
run: cargo fmt -- --check
- name: Run unit-tests
run: tests/run_all.sh
shell: bash
Expand All @@ -46,6 +50,10 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-test-windows-${{ runner.os }}-stable
cache-workspace-crates: "true"
- name: Build
run: cargo build --all-features
- name: Cargo Test
Expand All @@ -63,6 +71,10 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-test-macos-${{ runner.os }}-stable
cache-workspace-crates: "true"
- name: Build
run: cargo build --all-features
- name: Cargo Test
Expand All @@ -71,6 +83,30 @@ jobs:
run: tests/run_all.sh
shell: bash

release-build:
name: Release Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-release-build-${{ runner.os }}-stable
cache-workspace-crates: "true"
- name: Build (release)
run: cargo build --release --all-features

clippy_check:
name: Clippy
runs-on: ubuntu-latest
Expand All @@ -82,6 +118,10 @@ jobs:
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-clippy-${{ runner.os }}-stable
cache-workspace-crates: "true"
- run: cargo clippy --all-features

unused-deps:
Expand All @@ -92,6 +132,10 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-unused-deps-${{ runner.os }}-stable
cache-workspace-crates: "true"
- name: Install machete
run: cargo install cargo-machete
- name: Check for unused dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cli_regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: formatting

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Check Rust formatting
run: cargo fmt -- --check

clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Check C/C++ formatting
uses: DoozyX/clang-format-lint-action@v0.18
with:
source: "."
extensions: "h,hpp,c,cc,cpp,cxx"
exclude: "./crates/bender-slang/vendor"
Loading