Skip to content

Commit

Permalink
Merge pull request #240 from Zncl2222/develop
Browse files Browse the repository at this point in the history
v1.2.10
  • Loading branch information
Zncl2222 committed Jun 10, 2024
2 parents 65b1c68 + 6de5aec commit bca1851
Show file tree
Hide file tree
Showing 34 changed files with 1,283 additions and 1,532 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,37 @@ jobs:
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install -y valgrind
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y valgrind
- run: git submodule update --init --recursive

- 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: 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: 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: make test && make memcheck
- 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: make test && make memcheck

build_windows:
name: c-build-windows
runs-on: windows-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Pull Submodule
run: git submodule update --init --recursive
- name: build and test
run: |
.\cmake_build.bat
12 changes: 7 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Pull Submodule
run: git submodule update --init --recursive
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
Expand All @@ -55,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
setup-python-dependencies: false
Expand All @@ -70,7 +72,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -83,6 +85,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
8 changes: 4 additions & 4 deletions .github/workflows/github-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cpplint
- name: Checkout
uses: actions/checkout@v3
- uses: pre-commit/action@v3.0.0
uses: actions/checkout@v4
- uses: pre-commit/action@v3.0.1
49 changes: 45 additions & 4 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,52 @@ on:
types: [published]

jobs:
build_shared_library:
strategy:
matrix:
runs-on: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Pull Submodule
run: git submodule update --init --recursive
- name: Build DLL & Set file name windows
if: matrix.runs-on == 'windows-latest'
shell: pwsh
run: |
.\cmake_build.bat -s
echo "filename=uc_sgsim.dll" >> $env:GITHUB_ENV
- name: Build Shared Library & Set file name ubuntu
if: matrix.runs-on == 'ubuntu-latest'
run: |
sh ./cmake_build.sh -s
echo "filename=uc_sgsim.so" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runs-on }}-shared-library
path: ./uc_sgsim/c_core/${{ env.filename }}

test-release:
runs-on: ubuntu-latest
needs: [build_shared_library]
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
mv ./uc_sgsim.dll ./uc_sgsim/c_core
mv ./uc_sgsim.so ./uc_sgsim/c_core
- name: Build package
run: python -m build
- name: Publish distribution to Test PyPI
Expand All @@ -39,17 +72,25 @@ jobs:

release-job:
runs-on: ubuntu-latest
needs: [build_shared_library]
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
mv ./uc_sgsim.dll ./uc_sgsim/c_core
mv ./uc_sgsim.so ./uc_sgsim/c_core
- name: Build package
run: python -m build
- name: Publish distribution to PyPI
Expand Down
Loading

0 comments on commit bca1851

Please sign in to comment.