ci: move @ #45
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
name: CI | |
on: [push, pull_request] | |
jobs: | |
get-commit-hash-time: | |
name: Get commit hash time | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get commit hash time | |
id: hash_time | |
run: echo "HASH_TIME=$(git show --no-patch --format="@%h(%ci)")" >> "$GITHUB_ENV" | |
- name: Print commit hash time | |
run: echo "${{ env.HASH_TIME }}" | |
build-nix: | |
name: ${{ matrix.platform.name }}-${{ matrix.config.name }} | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: Linux GCC, os: ubuntu-latest } | |
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } | |
- { name: macOS, os: macos-latest } | |
config: | |
- { name: Dynamic, flags: -DBUILD_SHARED_LIBS=TRUE } | |
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE } | |
steps: | |
- name: Install Dependencies | |
if: runner.os == 'Linux' | |
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure | |
shell: bash | |
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}} | |
- name: Build | |
shell: bash | |
run: cmake --build build --config Release | |
- name: Install | |
shell: bash | |
run: cmake --install build --config Release | |
- name : Upload full build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.platform.name }}-${{ matrix.config.name }}${{ env.HASH_TIME }}-full | |
path: | | |
build/ | |
!build/_deps/ | |
# - name: Upload binary only artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}${{ env.HASH_TIME }}-binonly | |
# path: build/bin/ | |
build-windows-msys2: | |
name: ${{ matrix.platform.name }}-${{ matrix.config.name }} | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: Windows MSYS2 MinGW64, os: windows-2022, msys: true ,flags: -GNinja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ } | |
config: | |
- { name: Dynamic, flags: -DBUILD_SHARED_LIBS=TRUE } | |
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE } | |
steps: | |
- name: Install MSYS2 | |
if: ${{ matrix.platform.msys }} == true | |
uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
msystem: mingw64 | |
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure | |
shell: msys2 {0} | |
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}} | |
- name: Build | |
shell: msys2 {0} | |
run: cmake --build build --config Release | |
- name: Install | |
shell: msys2 {0} | |
run: cmake --install build --config Release | |
- name : Upload full build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.platform.name }}-${{ matrix.config.name }}${{ env.HASH_TIME }}-full | |
path: | | |
build/ | |
!build/_deps/ | |
# - name: Upload binary only artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}${{ env.HASH_TIME }}-binonly | |
# path: build/bin/ | |
# build-windows-msvc: | |
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }} | |
# runs-on: ${{ matrix.platform.os }} | |
# | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# platform: | |
# - { name: Windows VS2019, os: windows-2019, msys: false } | |
# - { name: Windows VS2022, os: windows-2022, msys: false } | |
# config: | |
# - { name: Dynamic, flags: -DBUILD_SHARED_LIBS=TRUE } | |
# - { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE } | |
# | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# | |
# - name: Configure | |
# run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}} | |
# | |
# - name: Build | |
# run: cmake --build build --config Release | |
# | |
# - name: Install | |
# run: cmake --install build --config Release | |
# | |
# - name : Upload full build artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: ${{ matrix.platform.name }}-${{ matrix.config.name }}${{ env.HASH_TIME }}-full | |
# path: | | |
# build/ | |
# !build/_deps/ | |
# | |
# # - name: Upload binary only artifact | |
# # uses: actions/upload-artifact@v3 | |
# # with: | |
# # name: ${{ matrix.platform.name }}-${{ matrix.config.name }}${{ env.HASH_TIME }}-binonly | |
# # path: build/bin/ |