Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ indent_style = space
[*.md]
trim_trailing_whitespace = false
max_line_length = 80

[*.yml]
indent_style = space
indent_size = 2
99 changes: 99 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: C/C++ CI

on: [push]

jobs:
build:
strategy:
matrix:
platform: [darwin, linux]
include:
- platform: darwin
arch: x64
build: osx64_clang
config: osx-release64
image: macos-latest
- platform: linux
arch: x64
build: linux64_gcc
config: linux-release64
image: ubuntu-latest
# - platform: windows
# arch: x64
# build: win64_vs2017
# config: vs2017-release64
# image: windows-latest
runs-on: ${{ matrix.image }}
steps:
- name: Checkout bgfx.
uses: actions/checkout@v1
with:
fetch-depth: 1
path: ./bgfx
- name: Checkout bx.
uses: actions/checkout@v1
with:
fetch-depth: 1
path: ./bx
ref: refs/heads/master
repository: bkaradzic/bx
- name: Checkout bImg.
uses: actions/checkout@v1
with:
fetch-depth: 1
path: ./bimg
ref: refs/heads/master
repository: bkaradzic/bimg
# TODO: cache this dependency.
- name: Install build dependencies (Linux).
if: matrix.platform == 'linux'
# See: https://bkaradzic.github.io/bgfx/build.html#linux
run: sudo apt-get install libgl1-mesa-dev x11proto-core-dev libx11-dev
- name: Generate project files.
run: make
- name: Compile.
run: make ${{matrix.config}}
- name: Fix rpath in OSX.
if: matrix.platform == 'darwin'
run: install_name_tool -id "@rpath/libbgfx-shared-libRelease.dylib" ./.build/${{ matrix.build }}/bin/libbgfx-shared-libRelease.dylib
- name: Copy relevant binaries to build artifact.
run: |
mkdir -p ../output/
cp -r ./.build/${{ matrix.build }}/bin/libbgfx-shared-libRelease* ../output/
cp -r ./.build/${{ matrix.build }}/bin/shadercRelease* ../output/
cp -r ./.build/${{ matrix.build }}/bin/texturecRelease* ../output/
- name: Upload binaries as artifact.
uses: actions/upload-artifact@v1
with:
name: binaries-${{ matrix.platform }}-${{ matrix.arch }}
path: ../output
- name: Upload failed build directory.
if: failure()
uses: actions/upload-artifact@v1
with:
name: debug-${{ matrix.platform }}-${{ matrix.arch }}
path: .
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
path: ./bgfx
- uses: actions/checkout@v1
with:
fetch-depth: 1
path: ./bx
ref: refs/heads/master
repository: bkaradzic/bx
- name: Copy include headers to build output.
run: |
mkdir -p ./output/include/bgfx ./output/include/bx
cp -r ./bgfx/include/bgfx/* ./output/include/bgfx
cp -r ./bx/include/bx/platform.h ./output/include/bx
working-directory: ${{ github.workspace }}/..
- uses: actions/upload-artifact@v1
with:
name: output
path: ../output