-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from ostis-ai/feat/cmake_external_project
Build system upgrades
- Loading branch information
Showing
189 changed files
with
2,825 additions
and
1,809 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 |
---|---|---|
|
@@ -5,3 +5,5 @@ README.md | |
codecov.yml | ||
.git | ||
.venv | ||
**/*.scdb | ||
/CMakeUserPresets.json |
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 |
---|---|---|
|
@@ -30,13 +30,22 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: apt cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
/var/cache/apt/ | ||
/var/lib/apt/ | ||
key: apt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/install_deps_ubuntu.sh') }} | ||
|
||
- name: Install dependencies | ||
id: install_deps | ||
run: scripts/install_deps_ubuntu.sh --dev | ||
|
||
- name: Restore build caches | ||
uses: hendrikmuhs/[email protected] | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.ccache | ||
key: ${{ github.job }}-${{ matrix.config.os }}-${{ matrix.config.cxx }}-${{ matrix.config.build_type }} | ||
|
||
- name: Build | ||
|
@@ -47,25 +56,25 @@ jobs: | |
BUILD_TYPE: ${{ matrix.config.build_type }} | ||
COVERAGE: ON | ||
SANITIZER_TYPE: none | ||
run: scripts/ci/make_tests.sh | ||
run: cmake --preset debug -DSC_COVERAGE=ON -DSC_BUILD_BENCH=OFF && cmake --build --preset debug | ||
|
||
- name: Prepare coverage | ||
id: prepare_coverage | ||
run: scripts/ci/prepare_coverage.sh | ||
|
||
- name: Run tests | ||
id: run_tests | ||
run: scripts/ci/run_tests.sh | ||
run: cd build/Debug && ctest -C Debug -V | ||
|
||
- name: Export coverage report | ||
id: export_coverage | ||
run: scripts/ci/export_coverage.sh | ||
|
||
- name: Upload coverage report to CodeCov | ||
uses: codecov/codecov-action@v4 | ||
uses: codecov/codecov-action@v4.6.0 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
directory: ${{github.workspace}}/build | ||
directory: ${{github.workspace}}/build/Debug | ||
files: coverage.info | ||
flags: unittests | ||
fail_ci_if_error: 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,32 @@ | ||
name: Docker | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build and Run | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: false | ||
load: true | ||
tags: ostis/sc-machine:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Run Docker Compose | ||
run: docker compose up -d --wait |
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
config: | ||
- { | ||
name: "Sanitizer - address", | ||
os: ubuntu-22.04, | ||
os: ubuntu-24.04, | ||
sanitizer: "address", | ||
cc: clang, | ||
cxx: clang++, | ||
|
@@ -30,13 +30,22 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: apt cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
/var/cache/apt/ | ||
/var/lib/apt/ | ||
key: apt-${{ runner.os }}-dev-${{ hashFiles('**/install_deps_ubuntu.sh') }} | ||
|
||
- name: Install dependencies | ||
id: install_deps | ||
run: scripts/install_deps_ubuntu.sh --dev | ||
|
||
- name: Restore build caches | ||
uses: hendrikmuhs/[email protected] | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.ccache | ||
key: ${{ github.job }}-${{ matrix.config.os}}-${{ matrix.config.cxx }}-${{ matrix.config.build_type }} | ||
|
||
- name: Build | ||
|
@@ -47,8 +56,8 @@ jobs: | |
BUILD_TYPE: ${{ matrix.config.build_type }} | ||
COVERAGE: OFF | ||
SANITIZER_TYPE: ${{ matrix.config.sanitizer }} | ||
run: scripts/ci/make_tests.sh | ||
run: cmake --preset debug -DSC_USE_SANITIZER=${{ matrix.config.sanitizer }} && cmake --build --preset debug | ||
|
||
- name: Run tests | ||
id: run_tests | ||
run: scripts/ci/run_tests.sh | ||
run: cd build/Debug && ctest -C Debug -V |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,7 +9,88 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
tests-conan: | ||
uses: ./.github/workflows/test_conan.yml | ||
check-dockerfile: | ||
uses: ./.github/workflows/check_dockerfile.yml | ||
build-conan: | ||
needs: tests-conan | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- { os: ubuntu-22.04, cc: "gcc", cxx: "g++" } | ||
- { os: macos-14, cc: "clang", cxx: "clang++" } | ||
|
||
runs-on: ${{ matrix.config.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Restore ccache caches | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ github.job }} | ||
|
||
- name: Conan cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.conan/data | ||
key: conan-${{ runner.os }}-${{ hashFiles('**/conanfile.py') }} | ||
|
||
- name: apt cache | ||
uses: actions/cache@v4 | ||
if: runner.os == 'Linux' | ||
with: | ||
path: | | ||
/var/cache/apt/ | ||
/var/lib/apt/ | ||
key: apt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/install_deps_ubuntu.sh') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Set up pipx | ||
run: | | ||
python -m pip install --user pipx | ||
python -m pipx ensurepath | ||
- name: Set up Conan | ||
run: | | ||
pipx install cmake | ||
pipx install conan | ||
- name: Install compilers (Ubuntu) | ||
if: runner.os == 'Linux' | ||
run: sudo apt install build-essential ninja-build ccache | ||
|
||
- name: Install compilers (macOS) | ||
if: runner.os == 'macOS' | ||
run: brew install cmake ninja ccache | ||
|
||
- name: Build sc-machine | ||
id: run_cmake | ||
run: | | ||
cmake --preset release-conan | ||
cmake --build --preset release | ||
- name: Create archive | ||
run: | | ||
cd ./build/Release | ||
cpack -G TGZ | ||
- name: Upload archive | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sc-machine-${{ matrix.config.os }}-${{ github.ref_name }} | ||
path: ./build/Release/sc-machine-*.tar.gz | ||
|
||
changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -29,6 +110,7 @@ jobs: | |
name: 'v${{ github.ref_name }}' | ||
|
||
docker: | ||
needs: check-dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
|
Oops, something went wrong.