Skip to content

fixing dockerfile

fixing dockerfile #930

Workflow file for this run

name: CMake
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BENCHMARK_BRANCHES: refs/heads/master refs/heads/develop
CC: gcc-14
CXX: g++-14
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: "3.28.*"
- name: Install Dependencies
shell: bash
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; \
sudo apt-get install gcc-13 g++-13 gcc-14 g++-14 python3; \
sudo apt-get update -qq;
- name: Set Benchmark Flag
uses: haya14busa/action-cond@v1
id: buildBenchmarksFlag
with:
cond: ${{ contains(env.BENCHMARK_BRANCHES, github.ref) }}
if_true: "ON"
if_false: "OFF"
- name: Create build Folders
id: buildFolder
working-directory: ${{github.workspace}}
shell: bash
run: |
mkdir -p build
mkdir -p .cpm-cache
mkdir -p .cpm-cache/gecode-6.3.0
mkdir -p .cpm-cache/gecode
- name: Checkout Gecode
id: gecode-checkout
uses: actions/checkout@v6
with:
repository: Gecode/gecode
ref: release/6.3.0
path: ${{github.workspace}}/.cpm-cache/gecode-6.3.0
- name: Build Gecode
id: gecode-build
working-directory: ${{github.workspace}}/.cpm-cache
env:
CMAKE_FLAGS: >
-DCMAKE_C_COMPILER=gcc-13
-DCMAKE_CXX_COMPILER=g++-13
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_BUILD_TYPE=Release
run: |
mkdir -p gecode-6.3.0/build
cmake -B gecode-6.3.0/build -S gecode-6.3.0
cmake --build gecode-6.3.0/build --config Release -j 8
cmake --install gecode-6.3.0/build --config Release --prefix gecode
rm -r gecode-6.3.0
- name: Build
id: build
working-directory: ${{github.workspace}}/build
env:
CMAKE_FLAGS: >
-DCMAKE_C_COMPILER=gcc-14
-DCMAKE_CXX_COMPILER=g++-14
-DBUILD_TESTS:BOOL=ON
-DBUILD_BENCHMARKS:BOOL=${{steps.buildBenchmarksFlag.outputs.value}}
-DCMAKE_BUILD_TYPE=${{steps.buildBenchmarksFlag.outputs.value == 'ON' && 'Release' || 'Debug'}}
-DCPM_SOURCE_CACHE=${{github.workspace}}/.cpm-cache
shell: bash
run: cmake $CMAKE_FLAGS ..; make -j 8
- name: Test
id: test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
run: ctest --output-on-failure
- name: Output Test Errors
if: failure() && steps.test.outcome == 'failure'
working-directory: ${{github.workspace}}/Testing/Temporary
run: |
FILE=./LastTest.log
if [ -f "$FILE" ]; then
cat "$FILE"
else
echo "$FILE not found"
fi
- name: Slack
id: slack
if: "!cancelled()"
uses: act10ns/slack@v1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_BUILD }}
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: "#build"
- name: Run Benchmarks
id: benchmarks
if: ${{ steps.buildBenchmarksFlag.outputs.value == 'ON' }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_BENCH }}
shell: bash
run: chmod +x ./slack-benchmark.sh; ./slack-benchmark.sh;
linux-sanitizers-advisory:
name: Linux Sanitizers Advisory (${{ matrix.sanitizer }})
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
sanitizer: [address, undefined]
include:
- sanitizer: address
test_env: ASAN_OPTIONS=detect_leaks=0:abort_on_error=1
- sanitizer: undefined
test_env: UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: "3.28.*"
- name: Install Dependencies
shell: bash
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; \
sudo apt-get install gcc-14 g++-14 python3; \
sudo apt-get update -qq;
- name: Configure
working-directory: ${{ github.workspace }}
shell: bash
run: |
cmake -S . -B build-${{ matrix.sanitizer }} \
-DBUILD_TESTS:BOOL=ON \
-DBUILD_BENCHMARKS:BOOL=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DATLANTIS_SANITIZERS=${{ matrix.sanitizer }}
- name: Build
working-directory: ${{ github.workspace }}
shell: bash
run: cmake --build build-${{ matrix.sanitizer }} -j 4
- name: Test
working-directory: ${{ github.workspace }}
shell: bash
run: env ${{ matrix.test_env }} ctest --test-dir build-${{ matrix.sanitizer }} --output-on-failure -j 4
- name: Summarize Advisory Result
if: always()
shell: bash
run: |
{
echo "### Linux sanitizer advisory: ${{ matrix.sanitizer }}"
echo
echo "- This job is non-blocking by design (`continue-on-error: true`)."
echo "- Treat failures here as guidance for cleanup, not as a merge gate."
echo "- Build URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
} >> "$GITHUB_STEP_SUMMARY"