Skip to content

Commit

Permalink
Create flasher.yml
Browse files Browse the repository at this point in the history
Try out GitHub actions
  • Loading branch information
leonrinkel authored Sep 21, 2023
1 parent fb454dd commit 35392b0
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/flasher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build flasher

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ${{ matrix.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
- 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

steps:
- uses: actions/checkout@v3

- name: Set reusable strings
id: strings
shell: bash
run: |
echo "source-dir=${{ github.workspace }}/software/flasher" >> "$GITHUB_OUTPUT"
echo "build-output-dir=${{ github.workspace }}/software/flasher/build" >> "$GITHUB_OUTPUT"
- 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_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ steps.strings.outputs.source-dir }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

0 comments on commit 35392b0

Please sign in to comment.