Skip to content

Custom event

Custom event #112

Workflow file for this run

name: CI Tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
env:
BUILD_DIR: "${{ github.workspace }}/build"
TEST_DIR: "${{ github.workspace }}/tests"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y build-essential gcc-multilib g++-multilib
- name: Install gcovr
run: pip install gcovr
- name: Setup project
run: cmake -S ${TEST_DIR} -B ${BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: cmake --build ${BUILD_DIR}
# - name: Test
# working-directory: build
# run: ctest -V
- name: Test with Coverage
working-directory: build
run: cmake --build ${BUILD_DIR} --target os_test_coverage
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint src
uses: jidicula/[email protected]
with:
clang-format-version: "18"
check-path: src
- name: Lint tests
uses: jidicula/[email protected]
with:
clang-format-version: "18"
check-path: tests/src
increment_version:
name: Increment Version
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [test, lint]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: conventional_commits
- name: Create tag
uses: actions/github-script@v5
if: "!contains(github.event.head_commit.message, 'NO RELEASE')"
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.version.outputs.version }}',
sha: context.sha
})