Skip to content

Commit

Permalink
Added Github actions to handle PR pipelines (#147)
Browse files Browse the repository at this point in the history
Replaced old azure pipeline CI with Github actions.
  • Loading branch information
SergioRZMasson authored Sep 5, 2024
1 parent d01d109 commit 187f76f
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 265 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Master - CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: 0 23 * * 1-5

jobs:
# Windows
build-windows:
uses: ./.github/workflows/windows.yml
with:
cmake-version: '3.26.3'
platforms: "['x64', 'Win32', 'ARM', 'ARM64']"
configurations: "['Release', 'Debug']"
# MacOS
build-macos:
uses: ./.github/workflows/macos.yml
with:
cmake-version: '3.26.3'
platforms: "['macOS']"
configurations: "['Release', 'Debug']"
# iOS
build-ios:
uses: ./.github/workflows/ios.yml
with:
cmake-version: '3.26.3'
platforms: "['iOS']"
configurations: "['Release', 'Debug']"
36 changes: 36 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'build ios'

on:
workflow_call:
inputs:
cmake-version:
required: true
type: string
platforms:
required: true
type: string
configurations:
required: true
type: string

jobs:
build:
runs-on: macos-latest
strategy:
matrix:
platform: ${{ fromJson(inputs.platforms) }}
config: ${{ fromJson(inputs.configurations) }}
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2.0.2
with:
cmake-version: ${{ inputs.cmake-version }}
- name: CMake Configure
run: cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/Build/CMake/ios.toolchain.cmake" -DPLATFORM=OS -DDEPLOYMENT_TARGET="10.11" -DENABLE_UNIT_TESTS="OFF" -B ./built/Int/cmake_${{ matrix.platform }} .
- name: CMake Build
run: cmake --build . --target install --config ${{ matrix.config }}
working-directory: ./built/Int/cmake_${{ matrix.platform }}
44 changes: 44 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'build macos'

on:
workflow_call:
inputs:
cmake-version:
required: true
type: string
platforms:
required: true
type: string
configurations:
required: true
type: string

jobs:
build:
runs-on: macos-latest
strategy:
matrix:
platform: ${{ fromJson(inputs.platforms) }}
config: ${{ fromJson(inputs.configurations) }}
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2.0.2
with:
cmake-version: ${{ inputs.cmake-version }}
- name: CMake Configure
run: cmake -G Xcode -B ./built/Int/cmake_${{ matrix.platform }} .
- name: CMake Build
run: cmake --build . --target install --config ${{ matrix.config }}
working-directory: ./built/Int/cmake_${{ matrix.platform }}
- name: Running Unit Tests
run: ./GLTFSDK.Test --gtest_output=xml:GLTFSDK.Test.log
working-directory: ./built/Out/${{ matrix.platform }}/${{ matrix.config }}/GLTFSDK.Test
- uses: actions/upload-artifact@v4
name: "Upload test results"
with:
name: GLTFSDK.Test.MacOS.${{ matrix.platform }}.${{ matrix.config }}
path: ${{ github.workspace }}/built/Out/${{ matrix.platform }}/${{ matrix.config }}/GLTFSDK.Test/GLTFSDK.Test.log
46 changes: 46 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'build windows'

on:
workflow_call:
inputs:
cmake-version:
required: true
type: string
platforms:
required: true
type: string
configurations:
required: true
type: string

jobs:
build:
runs-on: windows-2019
strategy:
matrix:
platform: ${{ fromJson(inputs.platforms) }}
config: ${{ fromJson(inputs.configurations) }}
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2.0.2
with:
cmake-version: ${{ inputs.cmake-version }}
- name: CMake Configure
run: cmake -G "Visual Studio 16 2019" -A ${{ matrix.platform }} -B ./built/Int/cmake_${{ matrix.platform }} .
- name: CMake Build
run: cmake --build . --target install --config ${{ matrix.config }}
working-directory: ./built/Int/cmake_${{ matrix.platform }}
- name: Running Unit Tests
if: ${{ (matrix.platform == 'x64') || (matrix.platform == 'Win32') }}
run: .\GLTFSDK.Test.exe --gtest_output=xml:GLTFSDK.Test.log
working-directory: ./built/Out/windows_${{ matrix.platform }}\${{ matrix.config }}\GLTFSDK.Test
- uses: actions/upload-artifact@v4
name: "Upload test results"
if: ${{ (matrix.platform == 'x64') || (matrix.platform == 'Win32') }}
with:
name: GLTFSDK.Test.Windows.${{ matrix.platform }}.${{ matrix.config }}
path: ${{ github.workspace }}\built\Out\windows_${{ matrix.platform }}\${{ matrix.config }}\GLTFSDK.Test\GLTFSDK.Test.log
Loading

0 comments on commit 187f76f

Please sign in to comment.