From d66c69c63706dbfec9b1f00c16306ad90531a46d Mon Sep 17 00:00:00 2001 From: "Keidan (K. Billonneau)" Date: Sun, 6 Mar 2022 12:31:03 +0100 Subject: [PATCH] Exporting builds to different files --- .github/workflows/build.yml | 95 ----------------------------------- .github/workflows/linux.yml | 59 ++++++++++++++++++++++ .github/workflows/windows.yml | 55 ++++++++++++++++++++ README.md | 6 ++- 4 files changed, 118 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index aa3b1ec..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,95 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Build - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - include: - - os: ubuntu-latest - name: "Ubuntu Latest GCC" - generators: "Ninja" - gtest: ./bin/hex2bin_gtest - hex2binPathDebug: bin/hex2bin - hex2binPathRelease: bin/hex2bin - - os: windows-latest - name: "Windows Latest MSVC" - generators: "Visual Studio 16 2019" - gtest: ./bin/Debug/hex2bin_gtest.exe - hex2binPathDebug: bin/Debug/hex2bin.exe - hex2binPathRelease: bin/Release/hex2bin.exe - - name: ${{ matrix.name }} - # The type of runner that the job will run on - runs-on: ${{ matrix.os }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Checkout the code - uses: actions/checkout@v2 - - name: Install dependencies on ${{ matrix.name }} - if: startsWith(matrix.os, 'ubuntu') - run: | - sudo apt-get update - sudo apt-get install cmake ninja-build python3 - ninja --version - cmake --version - gcc --version - python --version - - name: Install dependencies on ${{ matrix.name }} - if: startsWith(matrix.os, 'windows') - run: | - choco install ninja cmake python3 visualstudio2019community - ninja --version - cmake --version - python --version - - name: Configure for debug on ${{ matrix.name }} - if: startsWith(matrix.os, 'ubuntu') - shell: bash - run: cmake -S . -B build -DDISTRIBUTION=debug -G "${{ matrix.generators }}" - - name: Configure for debug on ${{ matrix.name }} - if: startsWith(matrix.os, 'windows') - shell: bash - run: cmake -S . -B build -DDISTRIBUTION=debug -G "${{ matrix.generators }}" -DCMAKE_GENERATOR_INSTANCE="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" - - name: Build debug on ${{ matrix.name }} - shell: bash - run: cmake --build build - - name: Run gtest on ${{ matrix.name }} - shell: bash - run: | - ${{ matrix.gtest }} - - name: Run test on ${{ matrix.name }} - shell: bash - run: | - python test.py --file ${{ matrix.hex2binPathDebug }} - - name: Configure for release on ${{ matrix.name }} - if: startsWith(matrix.os, 'ubuntu') - shell: bash - run: cmake -S . -B build -DDISTRIBUTION=release -G "${{ matrix.generators }}" - - name: Configure for release on ${{ matrix.name }} - if: startsWith(matrix.os, 'windows') - shell: bash - run: cmake -S . -B build -DDISTRIBUTION=release -G "${{ matrix.generators }}" -DCMAKE_GENERATOR_INSTANCE="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" - - name: Build release on ${{ matrix.name }} - shell: bash - run: cmake --build build - - name: Run test on ${{ matrix.name }} - shell: bash - run: | - python test.py --file ${{ matrix.hex2binPathRelease }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..2990521 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,59 @@ +# This is a basic workflow to help you get started with Actions + +name: Linux + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + name: Ubuntu Latest GCC + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Checkout the code + uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install cmake ninja-build python3 + ninja --version + cmake --version + gcc --version + python --version + - name: Configure for debug + shell: bash + run: cmake -S . -B build -DDISTRIBUTION=debug -G "Ninja" + - name: Build debug + shell: bash + run: cmake --build build + - name: Run gtest + shell: bash + run: | + ./bin/hex2bin_gtest + - name: Run test + shell: bash + run: | + python test.py --file bin/hex2bin + - name: Configure for release + shell: bash + run: cmake -S . -B build -DDISTRIBUTION=release -G "Ninja" + - name: Build release + shell: bash + run: cmake --build build + - name: Run test + shell: bash + run: | + python test.py --file bin/hex2bin diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..abbfc07 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,55 @@ +# This is a basic workflow to help you get started with Actions + +name: Build + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + name: Windows 2019 MSVC + # The type of runner that the job will run on + runs-on: windows-2019 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Checkout the code + uses: actions/checkout@v2 + - name: Install dependencies + run: | + choco install python3 + python --version + - name: Configure for debug + shell: bash + run: cmake -S . -B build -DDISTRIBUTION=debug -G "Visual Studio 16 2019" + - name: Build debug + shell: bash + run: cmake --build build + - name: Run gtest + shell: bash + run: | + ./bin/Debug/hex2bin_gtest.exe + - name: Run test + shell: bash + run: | + python test.py --file bin/Debug/hex2bin.exe + - name: Configure for release + shell: bash + run: cmake -S . -B build -DDISTRIBUTION=release -G "Visual Studio 16 2019" + - name: Build release + shell: bash + run: cmake --build build + - name: Run test + shell: bash + run: | + python test.py --file bin/Release/hex2bin.exe diff --git a/README.md b/README.md index dd97d52..ecbf0d0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # hex2bin -[![Build Status](https://github.com/Keidan/hex2bin/actions/workflows/build.yml/badge.svg)][build] +[![Linux CI](https://github.com/Keidan/hex2bin/actions/workflows/linux.yml/badge.svg)][linuxCI] +[![Windows CI](https://github.com/Keidan/hex2bin/actions/workflows/windows.yml/badge.svg)][windowsCI] [![CodeFactor](https://www.codefactor.io/repository/github/keidan/hex2bin/badge)][codefactor] [![Release](https://img.shields.io/github/v/release/Keidan/hex2bin.svg?logo=github)][releases] [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)][license] @@ -65,7 +66,8 @@ _For Windows, remember to add .exe after the binary name._ [GPLv3](https://github.com/Keidan/hex2bin/blob/master/license.txt) -[build]: https://github.com/Keidan/hex2bin/actions +[linuxCI]: https://github.com/Keidan/hex2bin/actions?query=workflow%3ALinux +[windowsCI]: https://github.com/Keidan/hex2bin/actions?query=workflow%3AWindows [codefactor]: https://www.codefactor.io/repository/github/keidan/hex2bin [releases]: https://github.com/Keidan/hex2bin/releases [license]: https://github.com/Keidan/hex2bin/blob/master/license.txt