-
Notifications
You must be signed in to change notification settings - Fork 8
Add GitHub Actions CI (Win32, macOS, Linux) #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
matthargett
wants to merge
2
commits into
BabylonJS:main
Choose a base branch
from
rebeckerspecialties:github-actions-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+157
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Build Linux | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| cc: | ||
| required: false | ||
| type: string | ||
| default: gcc | ||
| cxx: | ||
| required: false | ||
| type: string | ||
| default: g++ | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| env: | ||
| CC: ${{ inputs.cc }} | ||
| CXX: ${{ inputs.cxx }} | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install packages | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libcurl4-openssl-dev ninja-build clang | ||
|
|
||
| - name: Configure CMake | ||
| run: | | ||
| cmake -B Build/ubuntu -G Ninja \ | ||
| -D CMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
| -D CMAKE_C_COMPILER=${{ inputs.cc }} \ | ||
| -D CMAKE_CXX_COMPILER=${{ inputs.cxx }} | ||
|
|
||
| - name: Build | ||
| run: ninja -C Build/ubuntu | ||
|
|
||
| - name: Run Tests | ||
| working-directory: Build/ubuntu/Tests | ||
| run: ./UrlLibTests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Build macOS | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| xcode-version: | ||
| required: true | ||
| type: string | ||
| runs-on: | ||
| required: false | ||
| type: string | ||
| default: macos-latest | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ inputs.runs-on }} | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Select Xcode ${{ inputs.xcode-version }} | ||
| run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer | ||
|
|
||
| - name: Configure CMake | ||
| run: cmake -B Build/macOS -G Xcode | ||
|
|
||
| - name: Build | ||
| run: cmake --build Build/macOS --target UrlLibTests --config RelWithDebInfo | ||
|
|
||
| - name: Run Tests | ||
| working-directory: Build/macOS/Tests/RelWithDebInfo | ||
| run: ./UrlLibTests | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Build Win32 | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| platform: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: windows-2022 | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Configure CMake | ||
| run: cmake -B Build/Win32 -A ${{ inputs.platform }} | ||
|
|
||
| - name: Build Solution | ||
| run: cmake --build Build/Win32 --config RelWithDebInfo -- /m | ||
|
|
||
| - name: Enable Crash Dumps | ||
| shell: cmd | ||
| run: | | ||
| rem WER does not reliably create a custom DumpFolder at crash time; make sure it | ||
| rem exists before the registry points at it. | ||
| if not exist "%RUNNER_TEMP%\Dumps" mkdir "%RUNNER_TEMP%\Dumps" | ||
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UrlLibTests.exe" /f | ||
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UrlLibTests.exe" /v DumpType /t REG_DWORD /d 2 /f | ||
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UrlLibTests.exe" /v DumpCount /t REG_DWORD /d 1 /f | ||
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UrlLibTests.exe" /v DumpFolder /t REG_SZ /d "%RUNNER_TEMP%\Dumps" /f | ||
|
|
||
| - name: Run Tests | ||
| shell: cmd | ||
| working-directory: Build/Win32/Tests/RelWithDebInfo | ||
| run: UrlLibTests.exe | ||
|
|
||
| - name: Stage Test App for Crash Dumps | ||
| if: failure() | ||
| shell: powershell | ||
| run: | | ||
| New-Item -ItemType Directory -Force -Path "$env:RUNNER_TEMP\Dumps" | Out-Null | ||
| Copy-Item -Path "Build\Win32\Tests\RelWithDebInfo\UrlLibTests.*" -Destination "$env:RUNNER_TEMP\Dumps\" -ErrorAction SilentlyContinue | ||
|
matthargett marked this conversation as resolved.
|
||
|
|
||
| - name: Upload Crash Dumps | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.platform }}-crash-dumps | ||
| path: ${{ runner.temp }}/Dumps/ | ||
| if-no-files-found: ignore | ||
|
matthargett marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| # ── Win32 ───────────────────────────────────────────────────── | ||
| Win32_x64: | ||
| uses: ./.github/workflows/build-win32.yml | ||
| with: | ||
| platform: x64 | ||
|
|
||
| # ── macOS ───────────────────────────────────────────────────── | ||
| macOS_Xcode164: | ||
| uses: ./.github/workflows/build-macos.yml | ||
| with: | ||
| xcode-version: '16.4' | ||
| runs-on: macos-latest | ||
|
|
||
| # ── Linux ───────────────────────────────────────────────────── | ||
| Ubuntu_gcc: | ||
| uses: ./.github/workflows/build-linux.yml | ||
|
|
||
| Ubuntu_clang: | ||
| uses: ./.github/workflows/build-linux.yml | ||
| with: | ||
| cc: clang | ||
| cxx: clang++ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.