-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
138 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,137 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.name }} | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
name: | ||
- Ubuntu 16.04 GCC | ||
- Ubuntu 16.04 Clang | ||
- Ubuntu 18.04 GCC | ||
- Ubuntu 18.04 Clang | ||
- Windows 2019 MSVC | ||
# - Windows 2019 GCC | ||
- macOS 10.14 GCC | ||
- macOS 10.14 Clang | ||
include: | ||
- name: Ubuntu 16.04 GCC | ||
os: ubuntu-16.04 | ||
compiler: gcc | ||
cpp-compiler: g++ | ||
|
||
- name: Ubuntu 16.04 Clang | ||
os: ubuntu-16.04 | ||
compiler: clang | ||
cpp-compiler: clang++ | ||
packages: llvm-3.5 | ||
|
||
- name: Ubuntu 18.04 GCC | ||
os: ubuntu-18.04 | ||
compiler: gcc | ||
cpp-compiler: g++ | ||
|
||
- name: Ubuntu 18.04 Clang | ||
os: ubuntu-18.04 | ||
compiler: clang | ||
cpp-compiler: clang++ | ||
packages: llvm-3.9 | ||
|
||
- name: Windows 2019 MSVC | ||
os: windows-2019 | ||
compiler: cl | ||
cmake-args: -DBUILD_SHARED_LIBS=OFF -Dgtest_force_shared_crt=on | ||
|
||
# - name: Windows 2019 GCC | ||
# os: windows-2019 | ||
# compiler: gcc | ||
# cmake-args: -G Ninja | ||
# packages: ninja | ||
|
||
- name: macOS 10.14 GCC | ||
os: macOS-10.14 | ||
compiler: gcc | ||
cpp-compiler: g++ | ||
|
||
- name: macOS 10.14 Clang | ||
os: macOS-10.14 | ||
compiler: clang | ||
cpp-compiler: clang++ | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install packages (Ubuntu) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-net-dev libglew-dev ${{ matrix.packages }} | ||
- name: Install packages (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew update | ||
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf | ||
- name: Install packages (Windows) | ||
if: runner.os == 'Windows' && matrix.packages | ||
run: | | ||
choco install ${{ matrix.packages }} | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Generate project files | ||
run: | | ||
mkdir ${{ matrix.build-dir || '.not-used' }} | ||
cd ${{ matrix.build-dir || '.' }} | ||
cmake ${{ matrix.build-src-dir || '.' }} -Dtest=on ${{ matrix.cmake-args }} | ||
env: | ||
CC: ${{ matrix.compiler }} | ||
CXX: ${{ matrix.cpp-compiler }} | ||
CFLAGS: ${{ matrix.cflags || env.CFLAGS }} | ||
CXXFLAGS: ${{ matrix.cxxflags || env.CXXFLAGS }} | ||
LDFLAGS: ${{ matrix.ldflags || env.LDFLAGS }} | ||
|
||
- name: Compile source code | ||
run: | | ||
cd ${{ matrix.build-src-dir || '.' }} | ||
cmake --build . --config ${{ matrix.build-config || 'Release' }} | ||
zip -r tribilin.zip . -i Release/* | ||
echo "::set-output name=asset_name::tribilin.zip" | ||
echo "::set-output name=asset_path::tribilin.zip" | ||
- name: Run test cases | ||
run: | | ||
cd ${{ matrix.build-dir || '.' }} | ||
ctest -C ${{ matrix.build-config || 'Release' }} --output-on-failure | ||
- name: Prepare artifact | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
shell: bash | ||
run: | | ||
mkdir Release | ||
mv librosalila* Release | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: JustTestin | ||
path: Release | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./tribilin.zip | ||
asset_name: tribilin.zip | ||
asset_content_type: application/zip |