diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e2bfad3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +name: Build + +#on: +# release: +# types: [ created ] + +on: + push: + branches: [ ai ] + +env: + BUILD_TYPE: Release + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - name: Linux GCC x64 + os: ubuntu-latest + compiler_cc: gcc + compiler_cpp: g++ + asset_before: caravan + asset_after: caravan_linux_x64 + + - name: MacOS Clang x64 + os: macos-latest + compiler_cc: clang + compiler_cpp: clang++ + asset_before: caravan + asset_after: caravan_macos_x64 + + - name: Windows GCC x64 + os: windows-latest + compiler_cc: gcc + compiler_cpp: g++ + asset_before: caravan.exe + asset_after: caravan_windows_x64.exe + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install CMake and Ninja + uses: lukka/get-cmake@latest + with: + cmakeVersion: "~3.27.0" # use latest 3.27.x version + ninjaVersion: "^1.0" # use latest 1.x version + + - name: CMake Setup + run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: CMake Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target caravan + + - name: Rename Executable + working-directory: ./build + run: mv ${{matrix.asset_before}} ${{matrix.asset_after}} + + #- name: Upload Executable to Release + # uses: AButler/upload-release-assets@v3.0 + # with: + # files: ./build/${{matrix.asset_after}} + # repo-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 94a63de..0000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Linux - -on: - release: - types: [ created ] - -env: - BUILD_TYPE: Release - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - name: Linux GCC x64 - os: ubuntu-latest - compiler_cc: gcc - compiler_cpp: g++ - asset: caravan_linux_x64 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install CMake and Ninja - uses: lukka/get-cmake@latest - with: - cmakeVersion: "~3.27.0" # use most recent 3.27.x version - ninjaVersion: "^1.0" # use most recent 1.x version - - - name: CMake Setup - run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: CMake Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target caravan - - - name: Rename Executable - working-directory: ./build - run: mv caravan ${{matrix.asset}} - - - name: Upload Executable to Release - uses: AButler/upload-release-assets@v3.0 - with: - files: ./build/${{matrix.asset}} - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 3daaef8..0000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: MacOS - -on: - release: - types: [ created ] - -env: - BUILD_TYPE: Release - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - name: MacOS Clang x64 - os: macos-latest - compiler_cc: clang - compiler_cpp: clang++ - asset: caravan_macos_x64 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install CMake and Ninja - uses: lukka/get-cmake@latest - with: - cmakeVersion: "~3.27.0" # use most recent 3.27.x version - ninjaVersion: "^1.0" # use most recent 1.x version - - - name: CMake Setup - run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: CMake Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target caravan - - - name: Rename Executable - working-directory: ./build - run: mv caravan ${{matrix.asset}} - - - name: Upload Executable to Release - uses: AButler/upload-release-assets@v3.0 - with: - files: ./build/${{matrix.asset}} - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/testing.yml b/.github/workflows/tests.yml similarity index 80% rename from .github/workflows/testing.yml rename to .github/workflows/tests.yml index e610af5..89b7928 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/tests.yml @@ -1,15 +1,15 @@ -name: Testing +name: Tests on: push: - branches: [ main ] + branches: [ ai ] env: BUILD_TYPE: Debug jobs: - testing: - name: Testing + tests: + name: Tests runs-on: ${{ matrix.os }} strategy: matrix: @@ -26,8 +26,8 @@ jobs: - name: Install CMake and Ninja uses: lukka/get-cmake@latest with: - cmakeVersion: "~3.27.0" # use most recent 3.27.x version - ninjaVersion: "^1.0" # use most recent 1.x version + cmakeVersion: "~3.27.0" # use latest 3.27.x version + ninjaVersion: "^1.0" # use latest 1.x version - name: CMake Setup run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 88eff9e..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Windows - -on: - release: - types: [ created ] - -env: - BUILD_TYPE: Release - -jobs: - build: - name: Build - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - name: Windows GCC x64 - os: windows-latest - compiler_cc: gcc - compiler_cpp: g++ - asset: caravan_windows_x64.exe - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install CMake and Ninja - uses: lukka/get-cmake@latest - with: - cmakeVersion: "~3.27.0" # use most recent 3.27.x version - ninjaVersion: "^1.0" # use most recent 1.x version - - - name: CMake Setup - run: cmake -S . -B ${{github.workspace}}/build -G Ninja -D CMAKE_C_COMPILER=${{matrix.compiler_cc}} CMAKE_CXX_COMPILER=${{matrix.compiler_cpp}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: CMake Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target caravan - - - name: Rename Executable - working-directory: ./build - run: mv caravan.exe ${{matrix.asset}} - - - name: Upload Executable to Release - uses: AButler/upload-release-assets@v3.0 - with: - files: ./build/${{matrix.asset}} - repo-token: ${{ secrets.GITHUB_TOKEN }}