diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/build.yml similarity index 72% rename from .github/workflows/linux_builds.yml rename to .github/workflows/build.yml index 3308d5e4..81821a29 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,27 @@ -name: 🏁 Linux Builds -on: - push: - branches: [ master, main ] +name: 🏁 Builds and Tests +on: + push: + branches: + - master + pull_request: env: BUILD_TYPE: release jobs: - linux-compilation: - name: Linux Compilation - runs-on: "ubuntu-20.04" + compilation: + name: Compilation and Unit Tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: macos-latest + artifact: macos + - os: windows-latest + artifact: win64 + - os: "ubuntu-20.04" + artifact: linux + steps: # Checkout project @@ -19,37 +31,43 @@ jobs: - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build + # Run CMake configuration to create build files - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + # Build using CMake and OS toolkit - name: Build working-directory: ${{github.workspace}}/build shell: bash - # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE - - name: Tests + # Run CMake tests (unit tests, etc.) + - name: CTests working-directory: ${{github.workspace}}/build shell: bash run: ctest . -C $BUILD_TYPE -V + # Copy all build artifacts to the bin directory - name: Install working-directory: ${{github.workspace}}/build shell: bash run: cmake --install . --config $BUILD_TYPE --prefix bin + # Upload bin directory as artifact - name: Upload Artifacts uses: actions/upload-artifact@v1 with: - name: linux + name: ${{ matrix.artifact }} path: build/bin/ - linux-ink-proof: + # Run Ink Proof and Generate a GitHub page + ink-proof-pages: name: Ink Proof Page Generation runs-on: "ubuntu-latest" - needs: "linux-compilation" + needs: compilation + if: github.ref == 'refs/heads/master' steps: # Checkout project with submodules diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml deleted file mode 100644 index a0d29f15..00000000 --- a/.github/workflows/macos_builds.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: 🏁 MacOS Builds -on: - push: - branches: [ master, main, github_actions_brook ] - -env: - BUILD_TYPE: release - -jobs: - windows-compilation: - name: MacOS Compilation - runs-on: "macos-latest" - steps: - - # Checkout project - - uses: actions/checkout@v2 - - # Create a build directory to store all the CMake generated files - - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - shell: bash - working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{github.workspace}}/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE - - - name: Tests - working-directory: ${{github.workspace}}/build - shell: bash - run: ctest . -C $BUILD_TYPE -V - - - name: Install - working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --install . --config $BUILD_TYPE --prefix bin - - - name: Upload Artifacts - uses: actions/upload-artifact@v1 - with: - name: macos - path: build/bin/ \ No newline at end of file diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml deleted file mode 100644 index bab25f55..00000000 --- a/.github/workflows/windows_builds.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: 🏁 Windows Builds -on: - push: - branches: [ master, main ] - -env: - BUILD_TYPE: release - -jobs: - windows-compilation: - name: Windows Compilation - runs-on: "windows-latest" - steps: - - # Checkout project - - uses: actions/checkout@v2 - - # Create a build directory to store all the CMake generated files - - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - shell: bash - working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{github.workspace}}/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config $BUILD_TYPE - - - name: Tests - working-directory: ${{github.workspace}}/build - shell: bash - run: ctest . -C $BUILD_TYPE -V - - - name: Install - working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --install . --config $BUILD_TYPE --prefix bin - - - name: Upload Artifacts - uses: actions/upload-artifact@v1 - with: - name: win64 - path: build/bin/ \ No newline at end of file