Skip to content

chore: change github mirror #699

chore: change github mirror

chore: change github mirror #699

Workflow file for this run

name: CMake
on: [push, pull_request]
jobs:
build-windows:
env:
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- type: Win32
triplet: x86-windows-static
mono: ''
dll_sfx: windows.i386
- type: x64
triplet: x64-windows-static
mono: ''
dll_sfx: windows.amd64
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}\vcpkg\vcpkg.exe
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: cmd
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: bootstrap-vcpkg.bat
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -A ${{ matrix.type }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
- name: Build
shell: bash
working-directory: ${{github.workspace}}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
shell: bash
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"
build-macos:
env:
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
triplet: x64-osx
mono: 'mono'
dll_sfx: macos.amd64
- arch: arm64
triplet: arm64-osx
mono: 'mono'
dll_sfx: macos.aarch64
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/vcpkg/vcpkg
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: ./bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
- name: Build
working-directory: ${{github.workspace}}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"
build-linux:
env:
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- apt: g++-8
cc: gcc-8
cxx: g++-8
triplet: x64-linux
mono: 'mono'
dll_sfx: linux.amd64
- path: /usr/i686-linux-gnu
apt: g++-8-i686-linux-gnu
cc: i686-linux-gnu-gcc-8
cxx: i686-linux-gnu-g++-8
triplet: x86-linux
mono: 'mono'
dll_sfx: linux.i386
- path: /usr/aarch64-linux-gnu
apt: g++-aarch64-linux-gnu
cc: aarch64-linux-gnu-gcc
cxx: aarch64-linux-gnu-g++
triplet: arm64-linux
mono: 'mono'
dll_sfx: linux.aarch64
- path: /usr/arm-linux-gnueabihf
apt: g++-arm-linux-gnueabihf
cc: arm-linux-gnueabihf-gcc
cxx: arm-linux-gnueabihf-g++
triplet: arm-linux
mono: 'mono'
dll_sfx: linux.arm
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Install Cross Compiler
run: sudo apt-get update && sudo apt-get install ${{ matrix.apt }}
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/vcpkg/vcpkg
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: ./bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}/triplets -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_PREFIX_PATH=${{ matrix.path }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"
build-android:
env:
ANDROID_NDK: $ANDROID_NDK_HOME
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- abi: armeabi-v7a with NEON
triplet: arm-neon-android
mono: 'mono'
dll_sfx: android.arm
- abi: arm64-v8a
triplet: arm64-android
mono: 'mono'
dll_sfx: android.aarch64
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/vcpkg/vcpkg
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: ./bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DANDROID_ABI="${{ matrix.abi }}" -DCMAKE_SYSTEM_NAME=ANDROID -DANDROID_PLATFORM=21 -DCMAKE_SYSTEM_VERSION=21
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"