Added a trade manager to record trades #49
Workflow file for this run
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
on: | |
# Trigger analysis when pushing in master or pull requests, and when creating | |
# a pull request. | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
name: Build | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | |
jobs: | |
build: | |
name: Build & Test | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install packages | |
run: > | |
bash ./.github/workflows/brew.sh | |
- name: Build libraries | |
run: > | |
bash ./.github/workflows/build.sh | |
- name: Select Xcode | |
run: sudo xcode-select -switch /Applications/Xcode_15.2.app && /usr/bin/xcodebuild -version | |
- name: Run tests | |
run: > | |
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
xcodebuild | |
-scheme tests | |
-destination 'platform=macOS' | |
-resultBundlePath TestResult/ | |
-enableCodeCoverage YES | |
-derivedDataPath "${RUNNER_TEMP}/Build/DerivedData" | |
HEADER_SEARCH_PATHS="./external/libpqxx/include/pqxx/internal ./external/libpqxx/include/ ./external/libpqxx/build/include/ ./external/" \ | |
LIBRARY_SEARCH_PATHS="./external/libpqxx/src/ ./external/libpqxx/build/src/" \ | |
OTHER_LDFLAGS="-L./external/libpqxx/build/src -lpqxx -lpq -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib/pkgconfig -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14 -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pgxs -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pkgconfig" | |
clean build test | |
| xcpretty -r junit && exit ${PIPESTATUS[0]} | |
- name: Convert coverage report to sonarqube format | |
run: > | |
bash ./.github/workflows/xccov-to-sonarqube-generic.sh *.xcresult/ > sonarqube-generic-coverage.xml | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
path: sonarqube-generic-coverage.xml | |
retention-days: 1 # Artifact will be available only for 5 days. | |
sonar-scan: | |
name: Sonar scan | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout repository on branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.HEAD_REF }} | |
fetch-depth: 0 | |
- name: Check compiler version | |
run: | | |
g++ --version | |
cmake --version | |
- name: Build libraries | |
run: > | |
bash ./.github/workflows/build.sh | |
- name: Set up Python 3.8 for gcovr | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: install gcovr 5.0 | |
run: | | |
pip install gcovr==5.0 # 5.1 is not supported by sonarcloud | |
- name: Install sonar-scanner and build-wrapper | |
uses: SonarSource/sonarcloud-github-c-cpp@v3 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Unpack Artifact | |
run: > | |
ls -l ./ | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Run build-wrapper | |
run: | | |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here | |
run: | | |
sonar-scanner \ | |
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \ | |
-Dsonar.coverageReportPaths=artifact/sonarqube-generic-coverage.xml |