Skip to content

Heuristic route generation #602

Heuristic route generation

Heuristic route generation #602

Workflow file for this run

name: C++ CI
on:
pull_request:
merge_group:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
CTEST_PARALLEL_LEVEL: 1
jobs:
read-parameters:
name: read-parameters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Read current gurobi Version
uses: zlatko-ms/varfiletoenv@v3
with:
paths: ./.github/gurobi_version.json
- name: Export variables for next jobs
uses: UnlyEd/github-action-store-variable@v3 # See https://github.com/UnlyEd/github-action-store-variable
with:
variables: |
gurobiVersion=${{ env.gurobiVersion }}
gurobiShortVersion=${{ env.gurobiShortVersion }}
gurobiFolder=${{ env.gurobiFolder }}
cpp-ubuntu-latest:
name: cpp-ubuntu-latest
runs-on: ubuntu-latest
needs: read-parameters
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup-gurobi-license
id: write-license
env:
GUROBI_LICENSE: ${{ secrets.GUROBI_LICENSE }}
run: |
echo "$GUROBI_LICENSE" > $PWD/gurobi.lic
echo "GRB_LICENSE_FILE=$PWD/gurobi.lic" >> $GITHUB_ENV
- name: Import variables
uses: UnlyEd/github-action-store-variable@v3 # See https://github.com/UnlyEd/github-action-store-variable
with:
variables: |
gurobiVersion
gurobiShortVersion
gurobiFolder
- name: download-gurobi-linux
env:
GUROBI_VERSION_SHORT: ${{ env.gurobiShortVersion }}
GUROBI_VERSION: ${{ env.gurobiVersion }}
GUROBI_VERSION_FOLDER: ${{ env.gurobiFolder }}
GUROBI_FILE: gurobi${{ env.gurobiVersion }}_linux64.tar.gz
run: |
wget https://packages.gurobi.com/${{ env.GUROBI_VERSION_SHORT }}/${{ env.GUROBI_FILE }}
tar -xvzf ${{ env.GUROBI_FILE }}
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ${{ matrix.config.toolchain }}
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 500
cpp-macos-latest:
name: cpp-macos-latest
runs-on: macos-latest
needs: read-parameters
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup-gurobi-license
id: write-license
env:
GUROBI_LICENSE: ${{ secrets.GUROBI_LICENSE_TWO }}
run: |
echo "$GUROBI_LICENSE" > $PWD/gurobi.lic
echo "GRB_LICENSE_FILE=$PWD/gurobi.lic" >> $GITHUB_ENV
- name: Import variables
uses: UnlyEd/github-action-store-variable@v3 # See https://github.com/UnlyEd/github-action-store-variable
with:
variables: |
gurobiVersion
gurobiShortVersion
gurobiFolder
- name: download-gurobi-mac
env:
GUROBI_VERSION_SHORT: ${{ env.gurobiShortVersion }}
GUROBI_VERSION: ${{ env.gurobiVersion }}
GUROBI_VERSION_FOLDER: ${{ env.gurobiFolder }}
GUROBI_FILE: gurobi${{ env.gurobiVersion }}_macos_universal2.pkg
run: |
wget https://packages.gurobi.com/${{ env.GUROBI_VERSION_SHORT }}/${{ env.GUROBI_FILE }}
sudo installer -pkg ${{ env.GUROBI_FILE }} -target /
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ${{ matrix.config.toolchain }}
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 500
cpp-windows-latest:
name: cpp-windows-latest
runs-on: windows-latest
needs: cpp-macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup-gurobi-license
id: write-license
env:
GUROBI_LICENSE: ${{ secrets.GUROBI_LICENSE_TWO }}
run: |
echo "$GUROBI_LICENSE" > $PWD/gurobi.lic
echo "GRB_LICENSE_FILE=$PWD/gurobi.lic" >> $GITHUB_ENV
- name: Import variables
uses: UnlyEd/github-action-store-variable@v3 # See https://github.com/UnlyEd/github-action-store-variable
with:
variables: |
gurobiVersion
gurobiShortVersion
gurobiFolder
- name: download-gurobi-windows
shell: powershell
env:
GUROBI_VERSION_SHORT: ${{ env.gurobiShortVersion }}
GUROBI_VERSION: ${{ env.gurobiVersion }}
GUROBI_VERSION_FOLDER: ${{ env.gurobiFolder }}
GUROBI_FILE: Gurobi-${{ env.gurobiVersion }}-win64.msi
run: |
wget https://packages.gurobi.com/${{ env.GUROBI_VERSION_SHORT }}/${{ env.GUROBI_FILE }} -OutFile ${{ env.GUROBI_FILE }}
New-Item -itemType directory gurobi
$proc = Start-Process msiexec.exe -ArgumentList "/a ${{ env.GUROBI_FILE }} /qb /L*! install.log TARGETDIR=$PWD\gurobi" -NoNewWindow -PassThru
$timeouted = $null
$proc | Wait-Process -Timeout 120 -ErrorAction SilentlyContinue -ErrorVariable timeouted
if ($timeouted)
{
echo "TIMEOUT"
$proc.Kill()
}
cat install.log
ls $PWD\gurobi
- name: set-gurobi-env-variables
id: gurobi-env-variables
shell: powershell
run: |
echo "GUROBI_HOME=$PWD\gurobi\$env:gurobiFolder\win64" >> $env:GITHUB_ENV
echo "$PWD\gurobi\$env:gurobiFolder\win64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ${{ matrix.config.toolchain }}
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 500
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: cpp-ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup-gurobi-license
id: write-license
env:
GUROBI_LICENSE: ${{ secrets.GUROBI_LICENSE }}
run: |
echo "$GUROBI_LICENSE" > $PWD/gurobi.lic
echo "GRB_LICENSE_FILE=$PWD/gurobi.lic" >> $GITHUB_ENV
- name: Import variables
uses: UnlyEd/github-action-store-variable@v3 # See https://github.com/UnlyEd/github-action-store-variable
with:
variables: |
gurobiVersion
gurobiShortVersion
gurobiFolder
- name: download-gurobi-linux
env:
GUROBI_VERSION_SHORT: ${{ env.gurobiShortVersion }}
GUROBI_VERSION: ${{ env.gurobiVersion }}
GUROBI_VERSION_FOLDER: ${{ env.gurobiFolder }}
GUROBI_FILE: gurobi${{ env.gurobiVersion }}_linux64.tar.gz
run: |
wget https://packages.gurobi.com/${{ env.GUROBI_VERSION_SHORT }}/${{ env.GUROBI_FILE }}
tar -xvzf ${{ env.GUROBI_FILE }}
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DENABLE_COVERAGE=ON
- name: Build
run: cmake --build build --config Debug --target rail_test
- name: Test
run: ctest -C Debug --output-on-failure --test-dir build --repeat until-pass:3 --timeout 500
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
gcov: true
gcov_ignore: "extern/**/*"
token: ${{ secrets.CODECOV_TOKEN }}