Skip to content

Commit

Permalink
Update CI (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurSonzogni committed Nov 26, 2022
1 parent 94cd2f9 commit 5ddc2aa
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 179 deletions.
213 changes: 128 additions & 85 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,90 +15,112 @@ jobs:
test:
name: "Tests"
strategy:
fail-fast: false
matrix:
include:
- name: "Linux GCC"
os: ubuntu-latest
cc: gcc
cxx: g++
compiler: gcc
test: true
cmake: cmake

- name: "Linux Clang"
os: ubuntu-latest
cc: clang
cxx: clang++
compiler: llvm
test: true
cmake: cmake

- name: "Linux emscripten"
os: ubuntu-latest
cc: emcc
cxx: "em++"
test: false
cmake: "emcmake cmake"

- name: "MacOS GCC"
- name: "MacOS clang"
os: macos-latest
cc: /usr/local/opt/gcc/bin/gcc-11
cxx: /usr/local/opt/gcc/bin/g++-11
test: true
cmake: cmake
compiler: llvm

#- name: "Windows MSVC"
#os: windows-latest
#cc: cl
#cxx: cl
#test: false
#cmake: cmake
- name: "Windows"
os: windows-latest
compiler: cl

- name: "WebAssembly"
os: ubuntu-latest
emscripten: true

runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v2

- name: "Enable MSVC command prompt"
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: "Setup Cpp"
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
clangtidy: false
cppcheck: false
gcovr: "5.0"
opencppcoverage: false

- name: "Install cmake"
uses: lukka/get-cmake@latest
- name: "Setup Java"
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: '17'
check-latest: true

- name: "Install Linux Dependencies"
if: runner.os == 'Linux'
if: ${{ runner.os == 'Linux' }}
run: sudo apt install libboost-graph-dev uuid-dev

- name: "Install boost for windows"
if: runner.os == 'Windows'
if: ${{ runner.os == 'Windows' }}
uses: MarkusJx/[email protected]
with:
boost_version: 1.73.0

- name: "Install dependencies for macOS"
if: runner.os == 'macOS'
if: ${{ runner.os == 'macOS' }}
run: |
brew install gcc
brew install boost
- name: "Setup Emscripten"
if: ${{ matrix.cc == 'emcc' }}
if: ${{ matrix.emscripten }}
uses: mymindstorm/setup-emsdk@v7

- name: "Build debug mode"
- name: "Configure emscripten"
if: ${{ matrix.emscripten }}
run: >
mkdir build;
cd build;
${{ matrix.cmake }} ..
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=${{ matrix.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }};
cmake --build . --config Release
emcmake cmake -S .
-B ./build
-DCMAKE_BUILD_TYPE:STRING=Debug
-DDIAGON_BUILD_TESTS:BOOL=OFF
-DDIAGON_BUILD_TESTS_FUZZER:BOOL=OFF;
- name: "Configure build only"
if: ${{ !matrix.emscripten && !matrix.test}}
run: >
cmake -S .
-B ./build
-DCMAKE_BUILD_TYPE:STRING=Debug
-DDIAGON_BUILD_TESTS:BOOL=OFF
-DDIAGON_BUILD_TESTS_FUZZER:BOOL=OFF;
- name: "Configure buil and tests"
if: ${{ !matrix.emscripten && matrix.test}}
run: >
cmake -S .
-B ./build
-DCMAKE_BUILD_TYPE:STRING=Debug
-DDIAGON_BUILD_TESTS:BOOL=ON
-DDIAGON_BUILD_TESTS_FUZZER:BOOL=OFF;
- name: "Build"
run: >
cmake --build ./build;
- name: "Run tests"
if: matrix.test
if: ${{ matrix.test}}
run: >
cd build;
./input_output_test
./input_output_test;
# Create a release on new v* tags
release:
Expand Down Expand Up @@ -126,81 +148,102 @@ jobs:
include:
- name: "Linux Clang"
os: ubuntu-latest
cc: clang
cxx: clang++
cmake: cmake
compiler: llvm
asset_path: build/diagon*Linux*

- name: "Linux emscripten"
- name: "WebAssembly"
os: ubuntu-latest
cc: emcc
cxx: em++
cmake: "emcmake cmake"
emscripten: true
asset_path: build/diagon-Web.zip

#- name: "MacOS clang"
#os: macos-latest
#cc: clang
#cxx: clang++
#test: true
#cmake: cmake
#asset_path: build/diagon*Darwin*

#- name: "Windows MSVC"
#os: windows-latest
#cc: cl
#cxx: cl
#test: false
#cmake: cmake
#asset_path: build/diagon*Win64*
- name: "MacOS"
os: macos-latest
compiler: llvm
asset_path: build/diagon*Darwin*

- name: "Windows"
os: windows-latest
compiler: cl
asset_path: build/diagon*Win64*

runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v2

- name: "Enable MSVC command prompt"
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: "Setup Cpp"
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
clangtidy: false
cppcheck: false
gcovr: "5.0"
opencppcoverage: false

- name: "Install cmake"
uses: lukka/get-cmake@latest
- name: "Setup Java"
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: '17'
check-latest: true

- name: "Install Linux Dependencies"
if: runner.os == 'Linux'
run: sudo apt install libboost-graph-dev uuid-dev zip
if: ${{ runner.os == 'Linux' }}
run: sudo apt install libboost-graph-dev uuid-dev

- name: "Install boost for windows"
if: runner.os == 'Windows'
if: ${{ runner.os == 'Windows' }}
uses: MarkusJx/[email protected]
with:
boost_version: 1.73.0

- name: "Install dependencies for macOS"
if: ${{ runner.os == 'macOS' }}
run: |
brew install gcc
brew install boost
- name: "Setup Emscripten"
if: ${{ matrix.cc == 'emcc' }}
if: ${{ matrix.emscripten }}
uses: mymindstorm/setup-emsdk@v7

- name: "Build release mode"
- name: "Configure cmake with emscripten"
if: ${{ matrix.emscripten }}
run: >
mkdir build;
cd build;
${{ matrix.cmake }} ..
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${{ matrix.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }};
cmake --build . --config Release;
make package;
emcmake cmake -S .
-B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DDIAGON_BUILD_TESTS:BOOL=OFF
-DDIAGON_BUILD_TESTS_FUZZER:BOOL=OFF;
- name: "Configure CMake"
if: ${{ !matrix.emscripten }}
run: >
cmake -S .
-B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DDIAGON_BUILD_TESTS:BOOL=OFF
-DDIAGON_BUILD_TESTS_FUZZER:BOOL=OFF;
- name: "Build"
run: >
cmake
--build ./build
--target package;
- name: "Upload native binaries"
uses: shogo82148/actions-upload-release-asset@v1
if: ${{ matrix.cc != 'emcc'}}
if: ${{ !matrix.emscripten }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.asset_path }}
overwrite: true

- name: "Make webAssembly distribution"
if: ${{ matrix.cc == 'emcc' }}
if: ${{ matrix.emscripten }}
run: >
cd build;
mkdir -p diagon-Web;
Expand All @@ -213,7 +256,7 @@ jobs:
zip -r diagon-Web.zip diagon-Web;
- name: "Upload WebAssembly distribution"
if: ${{ matrix.cc == 'emcc' }}
if: ${{ matrix.emscripten }}
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
Expand Down
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 5ddc2aa

Please sign in to comment.