From 35fc1dde9e5580febf49063ec2f0238a2bf6cf60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeromos=20Kov=C3=A1cs?= Date: Mon, 17 Mar 2025 17:21:56 +0100 Subject: [PATCH 1/4] ci: add ubuntu-24.04-arm --- .github/workflows/cmake-multi-platform.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index d5dcc44..ca5478e 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -4,9 +4,9 @@ name: CMake on multiple platforms on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main", "*" ] + branches: ["main", "*"] jobs: build: @@ -23,7 +23,7 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] build_type: [Release] c_compiler: [gcc, clang, cl] include: @@ -38,6 +38,12 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ + - os: ubuntu-24.04-arm + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-24.04-arm + c_compiler: clang + cpp_compiler: clang++ # macos - os: macos-latest c_compiler: gcc @@ -54,6 +60,9 @@ jobs: # ubuntu - os: ubuntu-latest c_compiler: cl + # ubuntu + - os: ubuntu-24.04-arm + c_compiler: cl # macos - os: macos-latest c_compiler: cl @@ -82,18 +91,18 @@ jobs: # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - name: Upload example executables + - name: Upload example executables, windows if: ${{ runner.os == 'Windows' }} uses: actions/upload-artifact@v4 with: name: examples_${{ matrix.os }}_${{ matrix.c_compiler }} path: ${{ steps.strings.outputs.build-output-dir }}/Release/* - - name: Upload example executables + - name: Upload example executables, unix-like if: ${{ runner.os != 'Windows' }} uses: actions/upload-artifact@v4 with: - name: examples_${{ matrix.os }}_${{ matrix.c_compiler }} + name: examples_${{ runner.os }}_${{ runner.arch }}_${{ matrix.c_compiler }} path: | ${{ steps.strings.outputs.build-output-dir }}/* !${{ steps.strings.outputs.build-output-dir }}/*/* From 3a4bc2032a65075f095abb42990c77c751b0604f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeromos=20Kov=C3=A1cs?= Date: Mon, 17 Mar 2025 17:32:20 +0100 Subject: [PATCH 2/4] ci: simplify upload --- .github/workflows/cmake-multi-platform.yml | 69 +++++++++------------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index ca5478e..2a392a3 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -25,47 +25,40 @@ jobs: matrix: os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] build_type: [Release] - c_compiler: [gcc, clang, cl] - include: - # windows - - os: windows-latest - c_compiler: cl - cpp_compiler: cl - # ubuntu - - os: ubuntu-latest - c_compiler: gcc - cpp_compiler: g++ - - os: ubuntu-latest - c_compiler: clang - cpp_compiler: clang++ - - os: ubuntu-24.04-arm - c_compiler: gcc - cpp_compiler: g++ - - os: ubuntu-24.04-arm - c_compiler: clang - cpp_compiler: clang++ - # macos - - os: macos-latest - c_compiler: gcc - cpp_compiler: g++ - - os: macos-latest - c_compiler: clang - cpp_compiler: clang++ + cpp_compiler: [g++, clang++, cl] + # include: + # # windows + # - os: windows-latest + # cpp_compiler: cl + # # ubuntu + # - os: ubuntu-latest + # cpp_compiler: g++ + # - os: ubuntu-latest + # cpp_compiler: clang++ + # - os: ubuntu-24.04-arm + # cpp_compiler: g++ + # - os: ubuntu-24.04-arm + # cpp_compiler: clang++ + # # macos + # - os: macos-latest + # cpp_compiler: g++ + # - os: macos-latest + # cpp_compiler: clang++ exclude: # windows - os: windows-latest - c_compiler: gcc + cpp_compiler: g++ - os: windows-latest - c_compiler: clang + cpp_compiler: clang++ # ubuntu - os: ubuntu-latest - c_compiler: cl + cpp_compiler: cl # ubuntu - os: ubuntu-24.04-arm - c_compiler: cl + cpp_compiler: cl # macos - os: macos-latest - c_compiler: cl + cpp_compiler: cl steps: - uses: actions/checkout@v4 @@ -83,7 +76,6 @@ jobs: 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 }} @@ -91,20 +83,13 @@ jobs: # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - name: Upload example executables, windows - if: ${{ runner.os == 'Windows' }} - uses: actions/upload-artifact@v4 - with: - name: examples_${{ matrix.os }}_${{ matrix.c_compiler }} - path: ${{ steps.strings.outputs.build-output-dir }}/Release/* - - - name: Upload example executables, unix-like - if: ${{ runner.os != 'Windows' }} + - name: Upload example executables uses: actions/upload-artifact@v4 with: - name: examples_${{ runner.os }}_${{ runner.arch }}_${{ matrix.c_compiler }} + name: cpptui-examples_${{ runner.os }}_${{ runner.arch }}_${{ matrix.cpp_compiler }} path: | ${{ steps.strings.outputs.build-output-dir }}/* !${{ steps.strings.outputs.build-output-dir }}/*/* !${{ steps.strings.outputs.build-output-dir }}/*.* !${{ steps.strings.outputs.build-output-dir }}/*Makefile + ${{ steps.strings.outputs.build-output-dir }}/Release/* From 8372e4992e230af24af258c675887d71933aa7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeromos=20Kov=C3=A1cs?= Date: Mon, 17 Mar 2025 18:01:47 +0100 Subject: [PATCH 3/4] ci(refactor): don't in-, just exclude --- .github/workflows/cmake-multi-platform.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2a392a3..c906ddc 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -26,24 +26,6 @@ jobs: os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] build_type: [Release] cpp_compiler: [g++, clang++, cl] - # include: - # # windows - # - os: windows-latest - # cpp_compiler: cl - # # ubuntu - # - os: ubuntu-latest - # cpp_compiler: g++ - # - os: ubuntu-latest - # cpp_compiler: clang++ - # - os: ubuntu-24.04-arm - # cpp_compiler: g++ - # - os: ubuntu-24.04-arm - # cpp_compiler: clang++ - # # macos - # - os: macos-latest - # cpp_compiler: g++ - # - os: macos-latest - # cpp_compiler: clang++ exclude: # windows - os: windows-latest From 765497fa8adf23a9513c8dbbc2215324608d4b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeromos=20Kov=C3=A1cs?= Date: Mon, 17 Mar 2025 18:38:04 +0100 Subject: [PATCH 4/4] typo: eliminate --- examples/snake.cpp | 2 +- tui.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/snake.cpp b/examples/snake.cpp index b241856..0481ed2 100644 --- a/examples/snake.cpp +++ b/examples/snake.cpp @@ -340,7 +340,7 @@ int main() { } catch (...) { tui::reset(); - std::cerr << "unknown error occured\n"; + std::cerr << "unknown error occurred\n"; return 1; } diff --git a/tui.hpp b/tui.hpp index 2865f66..37be957 100644 --- a/tui.hpp +++ b/tui.hpp @@ -42,7 +42,7 @@ namespace tui { #define csi_fn(name, ...) \ inline void name() { csi(__VA_ARGS__) } -// ANSII Escape Sequnce +// ANSII Escape Sequence #define esc(...) std::cout << concat("\x1B", __VA_ARGS__); // function using ANSII Escape Sequence #define esc_fn(name, ...) \