release v1.2.0 #115
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| workflow_dispatch: | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| jobs: | |
| # Matrix build with different compilers in containers | |
| build-and-test: | |
| name: Build & Test (${{ matrix.compiler }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| compiler: | |
| - gcc | |
| - clang | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build test container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.test | |
| push: false | |
| load: true | |
| tags: liblpm-test:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run tests with ${{ matrix.compiler }} | |
| run: | | |
| docker run --rm \ | |
| -e CC=${{ matrix.compiler == 'gcc' && 'gcc' || 'clang' }} \ | |
| -e CXX=${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }} \ | |
| liblpm-test:ci | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: test-results-${{ matrix.compiler }} | |
| path: test-results/ | |
| if-no-files-found: ignore | |
| # C++ bindings test | |
| test-cpp-bindings: | |
| name: Test C++ Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build C++ container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.cpp | |
| push: false | |
| load: true | |
| tags: liblpm-cpp:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run C++ tests | |
| run: | | |
| docker run --rm liblpm-cpp:ci | |
| # Go bindings test | |
| test-go-bindings: | |
| name: Test Go Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Go container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.go | |
| push: false | |
| load: true | |
| tags: liblpm-go:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run Go tests | |
| run: | | |
| docker run --rm liblpm-go:ci | |
| # Java bindings test | |
| test-java-bindings: | |
| name: Test Java Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Java container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.java | |
| push: false | |
| load: true | |
| tags: liblpm-java:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run Java tests | |
| run: | | |
| docker run --rm liblpm-java:ci | |
| # C# bindings test | |
| test-csharp-bindings: | |
| name: Test C# Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build C# container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.csharp | |
| push: false | |
| load: true | |
| tags: liblpm-csharp:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run C# tests | |
| run: | | |
| docker run --rm liblpm-csharp:ci | |
| # Lua bindings test | |
| test-lua-bindings: | |
| name: Test Lua Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Lua container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.lua | |
| push: false | |
| load: true | |
| tags: liblpm-lua:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run Lua tests | |
| run: | | |
| docker run --rm liblpm-lua:ci | |
| # Perl bindings test | |
| test-perl-bindings: | |
| name: Test Perl Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Perl container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.perl | |
| push: false | |
| load: true | |
| tags: liblpm-perl:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run Perl tests | |
| run: | | |
| docker run --rm liblpm-perl:ci | |
| # PHP bindings test | |
| test-php-bindings: | |
| name: Test PHP Bindings | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build PHP container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.php | |
| push: false | |
| load: true | |
| tags: liblpm-php:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run PHP tests | |
| run: | | |
| docker run --rm liblpm-php:ci | |
| # Python bindings test | |
| test-python-bindings: | |
| name: Test Python Bindings | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake | |
| python -m pip install --upgrade pip | |
| python -m pip install cython pytest pytest-cov scikit-build-core | |
| - name: Build liblpm | |
| run: | | |
| mkdir -p build && cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DLPM_TS_RESOLVERS=ON | |
| make -j$(nproc) | |
| sudo make install | |
| sudo ldconfig | |
| - name: Build Python bindings | |
| working-directory: bindings/python | |
| run: | | |
| pip install -e ".[dev]" | |
| - name: Run Python tests | |
| working-directory: bindings/python | |
| env: | |
| # Workaround for IFUNC/dlopen incompatibility | |
| LD_PRELOAD: /usr/local/lib/liblpm.so.1 | |
| run: | | |
| pytest tests/ -v --cov=liblpm --cov-report=xml | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: bindings/python/coverage.xml | |
| flags: python | |
| fail_ci_if_error: false | |
| # Code quality checks | |
| code-quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build dev container | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.dev | |
| push: false | |
| load: true | |
| tags: liblpm-dev:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run cppcheck | |
| run: | | |
| docker run --rm liblpm-dev:ci bash -c " | |
| cppcheck \ | |
| --enable=all \ | |
| --suppress=missingIncludeSystem \ | |
| --suppress=unusedFunction \ | |
| --inline-suppr \ | |
| --error-exitcode=1 \ | |
| -I include \ | |
| -I external/libdynemit/include \ | |
| src/ | |
| " | |
| continue-on-error: true | |
| - name: Check formatting (clang-format) | |
| run: | | |
| docker run --rm liblpm-dev:ci bash -c " | |
| find src include -name '*.c' -o -name '*.h' | \ | |
| xargs clang-format --dry-run --Werror | |
| " | |
| continue-on-error: true | |
| # CI Summary | |
| ci-summary: | |
| name: CI Summary | |
| runs-on: ubuntu-latest | |
| needs: [build-and-test, test-cpp-bindings, test-go-bindings, test-java-bindings, test-csharp-bindings, test-lua-bindings, test-perl-bindings, test-php-bindings, test-python-bindings, code-quality] | |
| if: always() | |
| steps: | |
| - name: Check CI status | |
| run: | | |
| echo "CI workflow completed" | |
| echo "Build and test: ${{ needs.build-and-test.result }}" | |
| echo "C++ bindings: ${{ needs.test-cpp-bindings.result }}" | |
| echo "Go bindings: ${{ needs.test-go-bindings.result }}" | |
| echo "Java bindings: ${{ needs.test-java-bindings.result }}" | |
| echo "C# bindings: ${{ needs.test-csharp-bindings.result }}" | |
| echo "Lua bindings: ${{ needs.test-lua-bindings.result }}" | |
| echo "Perl bindings: ${{ needs.test-perl-bindings.result }}" | |
| echo "PHP bindings: ${{ needs.test-php-bindings.result }}" | |
| echo "Python bindings: ${{ needs.test-python-bindings.result }}" | |
| echo "Code quality: ${{ needs.code-quality.result }}" | |
| # Fail if any required job failed | |
| if [[ "${{ needs.build-and-test.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-cpp-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-go-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-java-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-csharp-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-lua-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-perl-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-php-bindings.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-python-bindings.result }}" == "failure" ]]; then | |
| echo "One or more required jobs failed" | |
| exit 1 | |
| fi |