Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gh actions #3

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/install-gperf/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Install gperf
description: Installs gperf on Linux, macOS, and Windows runners.
runs:
using: "composite"
steps:
- name: Install gperf on Linux
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y gperf

- name: Install gperf on macOS
if: runner.os == 'macOS'
shell: bash
run: |
brew update
brew install gperf

- name: Install gperf on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install gperf --yes
42 changes: 11 additions & 31 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.sys.os }}

strategy:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
sys:
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
cpp_compiler: cl
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
build_type: [Release]

steps:
- uses: actions/checkout@v4
Expand All @@ -41,22 +35,8 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Install gperf on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gperf

- name: Install gperf on macOS
if: runner.os == 'macOS'
run: |
brew update
brew install gperf

- name: Install gperf on Windows
if: runner.os == 'Windows'
run: |
choco install gperf --yes
- name: Install gperf
uses: ./.github/actions/install-gperf

- name: Verify gperf Installation
run: |
Expand All @@ -65,8 +45,8 @@ jobs:
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.sys.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.sys.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}/example

Expand Down