Skip to content

FEAT: implement yaml schemas #2336

FEAT: implement yaml schemas

FEAT: implement yaml schemas #2336

name: Build and run project
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]
env:
EXECUTABLE_NAME: nons
TEST_EXECUTABLE_NAME: test_nons
METRICS_ARTIFACT_DIR: metrics
OLD_METRICS_ARTIFACT_DIR: metrics/old
NEW_METRICS_ARTIFACT_DIR: metrics/new
jobs:
clang-format:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Clang Format
run: |
python3 -m venv venv
./venv/bin/pip install "clang-format==19.1.3"
- name: Check Clang format
run: |
./venv/bin/clang-format --version
./venv/bin/clang-format --dry-run -Werror $(git ls-files 'source/*.cpp' 'source/*.hpp' 'test/*.cpp' 'test/*.hpp')
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Configure CMake for building project
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROJECT=ON -DBUILD_TESTS=OFF
- name: Build project
run: cmake --build build --config Debug -j $(nproc)
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: build/**
run-simulations:
runs-on: ubuntu-24.04
needs: build
permissions:
contents: write
steps:
- name: Apt update
run: sudo apt update
- name: Install dependencies
run: |
sudo apt install --fix-missing gnuplot
sudo apt install --fix-missing graphviz
pip install graphviz
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-artifact
- name: Add executable flag
run: chmod +x ${{env.EXECUTABLE_NAME}}
- name: Run new simulations
run: python3 scripts/run_new_simulations.py -e ./${{env.EXECUTABLE_NAME}} --no-logs -c configs/scenario-configs.txt --output-dir ./${{env.NEW_METRICS_ARTIFACT_DIR}}
- name: Create html
run: python3 scripts/generate-html.py ./${{env.METRICS_ARTIFACT_DIR}}
- name: Upload metrics
uses: actions/upload-artifact@v4
with:
name: metrics
path: ${{env.METRICS_ARTIFACT_DIR}}/**
- name: Put github context to json file
run: echo '${{ toJson(github) }}' > github_context.json
- name: Calculate deploy destination dir
run: |
DEPLOY_DIR=$(python3 scripts/calculate_deploy_dir.py -c github_context.json);
echo "DEPLOY_DIR=${DEPLOY_DIR}/${{env.METRICS_ARTIFACT_DIR}}" >> $GITHUB_ENV;
- name: Deploy to GitHub Pages
if: ${{env.DEPLOY_DIR}} != ''

Check warning on line 97 in .github/workflows/cmake-single-platform.yml

View workflow run for this annotation

GitHub Actions / Build and run project

Workflow syntax warning

.github/workflows/cmake-single-platform.yml (Line: 97, Col: 11): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{env.METRICS_ARTIFACT_DIR}}
destination_dir: ${{env.DEPLOY_DIR}}
- name: Wait for artifacts to be available
run:
python3 scripts/check_artifacts.py -u 'https://cloud-storage-team.github.io/algnet/${{env.DEPLOY_DIR}}'
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Configure CMake for building tests
run: cmake -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_PROJECT=OFF -DBUILD_TESTS=ON
- name: Build tests
run: cmake --build build --config Debug -j $(nproc)
- name: Run tests
working-directory: build
run: ./${{env.TEST_EXECUTABLE_NAME}}