Skip to content

Commit

Permalink
Merge pull request #19 from pythonbrad/patch-1
Browse files Browse the repository at this point in the history
Added a github workflows to check the code
  • Loading branch information
Mindful authored Oct 20, 2024
2 parents 8d53547 + cff1397 commit 61ec255
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CMake

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

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Formatting
working-directory: ${{github.workspace}}/src/predict
run: cargo fmt --check

- name: Install dependencies
run: sudo apt install libibus-1.0-dev

- name: Rust Clippy
working-directory: ${{github.workspace}}/src/predict
run: cargo clippy --all-features --verbose

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

0 comments on commit 61ec255

Please sign in to comment.