diff --git a/.github/workflows/exchange-ci-darwin.yml b/.github/workflows/exchange-ci-darwin.yml deleted file mode 100644 index 2eaa1ace..00000000 --- a/.github/workflows/exchange-ci-darwin.yml +++ /dev/null @@ -1,218 +0,0 @@ -name: Exchange - Continuous Integration DARWIN - -on: - push: - branches: - - main - paths: - - 'exchange/**' - - '.github/workflows/exchange-ci-darwin.yml' - - pull_request: - branches: - - main - paths: - - 'exchange/**' - - '.github/workflows/exchange-ci-darwin.yml' - - workflow_dispatch: - -# We only care about the latest revision of a PR, so cancel all previous instances. -concurrency: - group: exchange-ci-darwin-${{ github.event.pull_request.number || github.ref_name }} - cancel-in-progress: true - -jobs: - lint: - runs-on: macos-14 - defaults: - run: - working-directory: exchange - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - uses: actions/setup-python@v4 - with: { python-version: "3.12" } - - - name: Install LLVM 17 - run: | - brew install llvm@17 - brew install clang-format - - - name: Install codespell - run: pip3 install codespell - - - name: Lint - run: cmake -D FORMAT_COMMAND=clang-format -P cmake/lint.cmake - - - name: Spell check - run: cmake -P cmake/spell.cmake - - unit-test: - needs: [lint] - - strategy: - matrix: - os: [macos-14] - - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: exchange - - - env: - CC: /opt/homebrew/opt/llvm/bin/clang - CXX: /opt/homebrew/opt/llvm/bin/clang++ - CLANG_DIR: '/opt/homebrew/opt/llvm/bin/clang' - LLVM_DIR: '/opt/homebrew/opt/llvm' - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install LLVM 17 - run: | - brew install llvm@17 - brew install clang-format - - - name: Install static analyzers - if: matrix.os == 'macos-14' - run: >- - brew install cppcheck - - - name: Install Python - uses: actions/setup-python@v4 - with: { python-version: "3.12" } - - - name: Install Python - uses: actions/setup-python@v4 - with: { python-version: "3.12-dev" } - - - name: Install dependencies - shell: bash - run: | - pip3 install conan - conan profile detect - python3 ../.github/scripts/write_config.py - conan install . -s build_type=Release -b missing - - - name: Setup MultiToolTask - if: matrix.os == 'windows-2022' - run: | - Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' - Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' - - - name: Configure - shell: pwsh - run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" - - - name: Build - run: cmake --build build --config Release -j - - - name: Install - run: cmake --install build --config Release --prefix prefix - - - name: Test - working-directory: exchange/build - run: ctest --output-on-failure --no-tests=error -C Release -j 2 -R "Unit*" - - integration-test: - needs: [lint] - - strategy: - matrix: - os: [macos-14] - - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: exchange - - env: - CC: /opt/homebrew/opt/llvm/bin/clang - CXX: /opt/homebrew/opt/llvm/bin/clang++ - CLANG_DIR: '/opt/homebrew/opt/llvm/bin/clang' - LLVM_DIR: '/opt/homebrew/opt/llvm' - NUTC_WRAPPER_BINARY_PATH: ${{ github.workspace }}/exchange/build/WRAPPER - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install LLVM 17 - run: | - brew install llvm@17 - brew install clang-format - - - name: Install static analyzers - if: matrix.os == 'macos-14' - run: >- - brew install cppcheck - - - name: Install RabbitMQ - if: matrix.os == 'macos-14' - run: >- - brew install rabbitmq - - - name: Install Python - uses: actions/setup-python@v4 - with: { python-version: "3.12" } - - - name: Install Python - uses: actions/setup-python@v4 - with: { python-version: "3.12-dev" } - - - name: Install dependencies - shell: bash - run: | - pip3 install conan - conan profile detect - python3 ../.github/scripts/write_config.py - conan install . -s build_type=Release -b missing - - - name: Setup MultiToolTask - if: matrix.os == 'windows-2022' - run: | - Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' - Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' - - - name: Configure exchange - shell: pwsh - run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" - - - name: Build exchange - run: cmake --build build --config Release -j - - - name: Install exchange - run: cmake --install build --config Release --prefix . - - - name: Move test algo files - run: cp -r test/test_algos build/test/test_algos - - - name: Start RabbitMQ - run: | - sudo systemctl start rabbitmq-server - sudo rabbitmqctl status - - # TODO: use secrets - - name: Configure RabbitMQ - run: | - sudo rabbitmqctl add_user NUFT ADMIN - sudo rabbitmqctl set_permissions -p / NUFT ".*" ".*" ".*" - sudo rabbitmqctl set_user_tags NUFT administrator - - - - name: Configure RabbitMQ Port - run: | - echo "listeners.tcp.default = 5672" | sudo tee -a /etc/rabbitmq/rabbitmq.conf - sudo systemctl restart rabbitmq-server - - - name: Test exchange - working-directory: exchange/build - run: ctest --output-on-failure --no-tests=error --timeout 10 -C Release -R "Integration*" diff --git a/.github/workflows/exchange-ci.yml b/.github/workflows/exchange-ci.yml index 62ffc064..9807da19 100644 --- a/.github/workflows/exchange-ci.yml +++ b/.github/workflows/exchange-ci.yml @@ -124,7 +124,77 @@ jobs: UBSAN_OPTIONS: print_stacktrace=1 run: ctest --output-on-failure --no-tests=error -j 2 -R "Unit*" - unit-test: + unit-test-darwin: + needs: [lint] + + strategy: + matrix: + os: [macos-14] + + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: exchange + + + env: + CC: /opt/homebrew/opt/llvm/bin/clang + CXX: /opt/homebrew/opt/llvm/bin/clang++ + CLANG_DIR: '/opt/homebrew/opt/llvm/bin/clang' + LLVM_DIR: '/opt/homebrew/opt/llvm' + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Install LLVM 17 + run: | + brew install llvm@17 + brew install clang-format + + - name: Install static analyzers + if: matrix.os == 'macos-14' + run: >- + brew install cppcheck + + - name: Install Python + uses: actions/setup-python@v4 + with: { python-version: "3.12" } + + - name: Install Python + uses: actions/setup-python@v4 + with: { python-version: "3.12-dev" } + + - name: Install dependencies + shell: bash + run: | + pip3 install conan + conan profile detect + python3 ../.github/scripts/write_config.py + conan install . -s build_type=Release -b missing + + - name: Setup MultiToolTask + if: matrix.os == 'windows-2022' + run: | + Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' + Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' + + - name: Configure + shell: pwsh + run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" + + - name: Build + run: cmake --build build --config Release -j + + - name: Install + run: cmake --install build --config Release --prefix prefix + + - name: Test + working-directory: exchange/build + run: ctest --output-on-failure --no-tests=error -C Release -j 2 -R "Unit*" + + unit-test-linux: needs: [lint] strategy: @@ -325,7 +395,7 @@ jobs: docs: # Deploy docs only when builds succeed - needs: [sanitize, unit-test, integration-test] + needs: [sanitize, unit-test-darwin, unit-test-linux, integration-test] runs-on: ubuntu-22.04 defaults: diff --git a/.github/workflows/linter-cicd-darwin.yml b/.github/workflows/linter-cicd-darwin.yml deleted file mode 100644 index 1a53bb04..00000000 --- a/.github/workflows/linter-cicd-darwin.yml +++ /dev/null @@ -1,187 +0,0 @@ -name: Linter - Continuous Integration DARWIN - -on: - push: - branches: - - main - paths: - - 'linter/**' - - '.github/workflows/linter-cicd-darwin.yml' - - pull_request: - branches: - - main - paths: - - 'linter/**' - - '.github/workflows/linter-cicd-darwin.yml' - - workflow_dispatch: - -# We only care about the latest revision of a PR, so cancel all previous instances. -concurrency: - group: linter-ci-darwin-${{ github.event.pull_request.number || github.ref_name }} - cancel-in-progress: true - -jobs: - lint: - runs-on: macos-14 - defaults: - run: - working-directory: linter - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - uses: actions/setup-python@v4 - with: { python-version: "3.12" } - - - name: Install LLVM 17 - run: | - brew install llvm@17 - brew install clang-format - - - name: Install codespell - run: pip3 install codespell - - - name: Lint - run: cmake -D FORMAT_COMMAND=clang-format -P cmake/lint.cmake - - - name: Spell check - run: cmake -P cmake/spell.cmake - - sanitize: - needs: [lint] - - runs-on: macos-14 - defaults: - run: - working-directory: linter - - - env: - CC: /opt/homebrew/opt/llvm/bin/clang - CXX: /opt/homebrew/opt/llvm/bin/clang++ - CLANG_DIR: '/opt/homebrew/opt/llvm/bin/clang' - LLVM_DIR: '/opt/homebrew/opt/llvm' - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install Python - uses: actions/setup-python@v4 - with: { python-version: "3.12" } - - - name: Install Python Developer Headers - run: brew install python@3.12 - - - name: Install LLVM 17 - run: | - brew install llvm@17 - brew install clang-format - - - name: Install Cache Conan dependencies - id: cache-conan - uses: actions/cache@v3 - env: - cache-name: cache-conan-deps - with: - path: ~/.conan2 - key: ${{ runner.os }}-builder-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }} - restore-keys: ${{ runner.os }}-builder-${{ env.cache-name }}- - - - name: Install dependencies - run: | - pip3 install conan - conan profile detect - python3 ../.github/scripts/write_config.py - conan install . -s build_type=Release -b missing - - - name: Configure - run: cmake --preset=ci-sanitize-darwin - - - name: Build - run: cmake --build build/sanitize -j 2 - - - name: Test - working-directory: linter/build/sanitize - env: - ASAN_OPTIONS: "strict_string_checks=1:\ - detect_stack_use_after_return=1:\ - check_initialization_order=1:\ - strict_init_order=1:\ - detect_leaks=1" - UBSAN_OPTIONS: print_stacktrace=1 - run: ctest --output-on-failure --no-tests=error -j 2 - - test: - needs: [lint] - - strategy: - matrix: - os: [macos-14] - - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: linter - - - env: - CC: /opt/homebrew/opt/llvm/bin/clang - CXX: /opt/homebrew/opt/llvm/bin/clang++ - CLANG_DIR: '/opt/homebrew/opt/llvm/bin/clang' - LLVM_DIR: '/opt/homebrew/opt/llvm' - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install LLVM 17 - run: | - brew install llvm@17 - brew install clang-format - - - name: Install static analyzers - if: matrix.os == 'macos-14' - run: >- - brew install cppcheck - - - name: Install Python - uses: actions/setup-python@v4 - with: { python-version: "3.12" } - - - name: Install Python Developer Headers - run: brew install python@3.12 - - - name: Install dependencies - shell: bash - run: | - pip3 install conan - conan profile detect - python3 ../.github/scripts/write_config.py - conan install . -s build_type=Release -b missing - - - name: Setup MultiToolTask - if: matrix.os == 'windows-2022' - run: | - Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' - Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' - - - name: Configure - shell: pwsh - run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" - - - name: Build - run: cmake --build build --config Release -j 2 - - - name: Install - run: cmake --install build --config Release --prefix prefix - - - name: Test - working-directory: linter/build - run: ctest --output-on-failure --no-tests=error -C Release -j 2 diff --git a/.github/workflows/linter-cicd.yml b/.github/workflows/linter-cicd.yml index 06697df5..8f02d008 100644 --- a/.github/workflows/linter-cicd.yml +++ b/.github/workflows/linter-cicd.yml @@ -123,7 +123,7 @@ jobs: UBSAN_OPTIONS: print_stacktrace=1 run: ctest --output-on-failure --no-tests=error -j 2 - test: + test-linux: needs: [lint] strategy: @@ -200,9 +200,78 @@ jobs: working-directory: linter/build run: ctest --output-on-failure --no-tests=error -C Release -j 2 + test-darwin: + needs: [lint] + + strategy: + matrix: + os: [macos-14] + + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: linter + + env: + CC: /opt/homebrew/opt/llvm/bin/clang + CXX: /opt/homebrew/opt/llvm/bin/clang++ + CLANG_DIR: '/opt/homebrew/opt/llvm/bin/clang' + LLVM_DIR: '/opt/homebrew/opt/llvm' + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Install LLVM 17 + run: | + brew install llvm@17 + brew install clang-format + + - name: Install static analyzers + if: matrix.os == 'macos-14' + run: >- + brew install cppcheck + + - name: Install Python + uses: actions/setup-python@v4 + with: { python-version: "3.12" } + + - name: Install Python Developer Headers + run: brew install python@3.12 + + - name: Install dependencies + shell: bash + run: | + pip3 install conan + conan profile detect + python3 ../.github/scripts/write_config.py + conan install . -s build_type=Release -b missing + + - name: Setup MultiToolTask + if: matrix.os == 'windows-2022' + run: | + Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' + Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' + + - name: Configure + shell: pwsh + run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" + + - name: Build + run: cmake --build build --config Release -j 2 + + - name: Install + run: cmake --install build --config Release --prefix prefix + + - name: Test + working-directory: linter/build + run: ctest --output-on-failure --no-tests=error -C Release -j 2 + + docs: # Deploy docs only when builds succeed - needs: [sanitize, test] + needs: [sanitize, test-darwin, test-linux] runs-on: ubuntu-22.04 defaults: @@ -274,7 +343,7 @@ jobs: deploy-dockerimage: - needs: [lint, sanitize, test] + needs: [lint, sanitize, test-darwin, test-linux] # don't want to deploy if PR if: github.event_name == 'push'