Skip to content

Trying a different compiler #5

Trying a different compiler

Trying a different compiler #5

name: Hello World on Self-Hosted Runner
on:
push:
branches:
- TestSelfHostedRunner
jobs:
say-hello:
runs-on: self-hosted # Use the self-hosted runner
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Release]
c_compiler: [gcc]
include:
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
exclude:
- os: ubuntu-latest
c_compiler: gcc
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
shell: bash
run: |
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-S ${{ github.workspace }} \
-DCPM_SOURCE_CACHE=~/.cpm \
-DENABLE_TESTING=ON
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }} --output-on-failure -VV --verbose --output-junit ${{ github.workspace }}/scripts/junitout.xml
continue-on-error: true
- name: Convert XML to CTRF
if: success()
shell: bash
run: |
pip install defusedxml
pip install pillow
commit_msg=$(git log -1 --pretty=%B)
python "${{ github.workspace }}/scripts/OutPutResultsToJsons.py" "${{ github.workspace }}/scripts/junitout.xml" "Real Test" --json_output "${{ github.workspace }}/scripts/finalresult.json" --discord_json_output "${{ github.workspace }}/scripts/discordJson_output.json" --image_out "${{ github.workspace }}/scripts/discrod_image.png" --os "${{ runner.os }}" --compiler "${{ matrix.c_compiler }}" --event "${{ github.event_name }}" --author "${{ github.actor }}" --branch "${{ github.ref_name }}" --commit_msg "$commit_msg"
- name: Post results
if: success()
shell: bash
run: |
npm install [email protected]
npx github-actions-ctrf "${{ github.workspace }}/scripts/finalresult.json"
- name: Post results to Discord
if: success()
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
filename: "${{ github.workspace }}/scripts/discrod_image.png"