Skip to content

Rename namespace, tidy file layout #84

Rename namespace, tidy file layout

Rename namespace, tidy file layout #84

Workflow file for this run

name: gtest
on:
- push
- pull_request
jobs:
gtest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Figure out version
id: tag
run: |
TAG=$(git describe --tags --abbrev=0)
COMMITS_SINCE_TAG=$(git rev-list ${TAG}..HEAD --count)
if [ "${COMMITS_SINCE_TAG}" -eq 0 ]; then
echo "VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "VERSION="$(git describe --tags --abbrev=8) >> $GITHUB_ENV
fi
- name: Cache Conan2 dependencies
uses: actions/cache@v3
with:
path: ~/.conan2
key: ${{ runner.os }}-conan2-${{ hashFiles('**/conanfile.py') }}
restore-keys: |
${{ runner.os }}-conan2-
- name: Set up Python 3.8 for gcovr
uses: actions/setup-python@v4
- name: SonarQube install
uses: SonarSource/sonarcloud-github-c-cpp@v3
- name: Install Conan
run: pip install conan
- name: Configure Conan Profile
run: |
conan profile detect -e
conan remote add conan-nexus https://nexus.cridland.io/repository/dwd-conan --force
conan remote login conan-nexus ci --password ${{ secrets.NEXUS_PASSWORD }}
- name: Conan Deps
run: conan install . --output-folder=gh-build -s build_type=Debug -s compiler.cppstd=gnu23 -b missing --version=${{ env.VERSION }}
- name: Create package
run: conan create . --version=${{ env.VERSION }}
- name: Conan deps for tests
run: cd test && conan install . --output-folder=. -s build_type=Debug -s compiler.cppstd=gnu23 -b missing --version=${{ env.VERSION }}
- name: CMake tests
run: cd test && cmake -B gh-build -DCMAKE_BUILD_TYPE=Debug
- name: Build Wrapper
run: cd test && build-wrapper-linux-x86-64 --out-dir sonar-out cmake --build gh-build
- name: Sonar Scanner
run: cd test && sonar-scanner --define sonar.cfamily.compile-commands=sonar-out/compile_commands.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Run Tests
run: cd test/gh-build && ./rapidxml-test
- name: Upload
run: conan upload -r conan-nexus --confirm 'flxml/*'