Skip to content

Commit

Permalink
Adjust GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nhusung committed Apr 2, 2024
1 parent 34dc9bd commit a28a0e0
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 13 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: C++

# spell-checker:ignore DCMAKE

on:
push:
branches: ["main"]
paths:
- 'bindings/cpp/**'
- 'CMakeLists.txt'
- 'crates/**'
- 'Cargo.*'
pull_request:
branches: ["main"]
paths:
- 'bindings/cpp/**'
- 'CMakeLists.txt'
- 'crates/**'
- 'Cargo.*'

env:
CARGO_TERM_COLOR: always

jobs:
lint:
name: Lint

runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- name: Generate oxidd/capi.h
working-directory: build
run: make oxidd-capi-header
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 18
ignore: "|!bindings/cpp"
database: "build/compile_commands.json"
style: "file" # Use .clang-format config file
tidy-checks: "" # Use .clang-tidy config file
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1


test:
name: Test

runs-on: ubuntu-latest

strategy:
matrix:
compiler:
- { cc: "gcc", cxx: "g++" }
- { cc: "clang", cxx: "clang++" }

steps:
- uses: actions/checkout@v4
- name: CMake Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
- name: Build
working-directory: build
run: make boolean-function
- name: Run Tests
working-directory: build
run: make test
27 changes: 14 additions & 13 deletions .github/workflows/pipeline.yml → .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
name: Pipeline
name: Rust

# spell-checker:ignore dtolnay

on:
push:
branches: ["main"]
paths:
- 'crates/**'
- 'Cargo.*'
pull_request:
branches: [ "main" ]
branches: ["main"]
paths:
- 'crates/**'
- 'Cargo.*'

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"

jobs:
lint:
Expand All @@ -23,14 +32,8 @@ jobs:
toolchain: nightly
components: clippy, rustfmt
- uses: extractions/setup-just@v1
- name: Install cSpell
run: npm install --prefix=.local/cspell -g cspell
- name: Lint
run: just lint
- name: Doc
run: cargo doc --no-deps
env:
RUSTDOCFLAGS: "-D warnings"
run: just lint-rust

test:
name: Test
Expand All @@ -39,8 +42,8 @@ jobs:

strategy:
matrix:
toolchain: ['stable', 'nightly']
flags: ['', '--release']
toolchain: ["stable", "nightly"]
flags: ["", "--release"]

steps:
- uses: actions/checkout@v4
Expand All @@ -49,7 +52,5 @@ jobs:
toolchain: ${{ matrix.toolchain }}
- name: Build
run: cargo build ${{ matrix.flags }} --verbose
env:
RUSTFLAGS: "-D warnings"
- name: Run Tests
run: cargo test ${{ matrix.flags }} --verbose
20 changes: 20 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Spell Check

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
spellcheck:
name: Spell Check

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v6
with:
check_dot_files: true
use_cspell_files: true

0 comments on commit a28a0e0

Please sign in to comment.