CI #1027
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 | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "backtrace" branch | |
push: | |
branches: ["backtrace"] | |
pull_request: | |
branches: ["backtrace"] | |
schedule: | |
- cron: "0 0 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
generator: ["Unix Makefiles", Ninja] | |
steps: | |
# Install latest CMake. | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install curl headers | |
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev | |
- name: CMake | |
run: | | |
mkdir cbuild | |
cmake -S . -B cbuild/ -DCRASHPAD_BUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}" | |
cmake --build cbuild/ | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.1" | |
working-directory: ./backtrace/test | |
bundler-cache: true | |
- name: Run tests | |
working-directory: ./backtrace/test | |
run: > | |
bundle exec ruby ./test.rb -v | |
- name: Crashpad distribution ZIP | |
run: | | |
ruby backtrace/save_artifacts.rb --output Crashpad_Linux_build.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Crashpad_Linux_build_${{ github.sha }} | |
path: Crashpad_Linux_build.zip | |
build-windows: | |
# Because we want to use Visual Studio 16 2019, we need to use the windows-2019 GitHub runner | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
generator: ["Visual Studio 16 2019", Ninja] | |
steps: | |
# Install latest CMake. | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Add cl.exe to PATH | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- name: CMake | |
run: | | |
# make a build directory (note: build is already used by Crashpad) | |
mkdir cbuild | |
# run CMake (additional options like -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE are possible) | |
# it is recommended to specify the compiler version used for the build | |
cmake -S . -B cbuild/ -DCRASHPAD_BUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}" -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe | |
cmake --build cbuild/ | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.1" | |
working-directory: ./backtrace/test | |
bundler-cache: true | |
- name: Run tests | |
working-directory: ./backtrace/test | |
run: | | |
bundle exec ruby ./test.rb -v | |
- name: Crashpad distribution ZIP | |
run: | | |
ruby backtrace/save_artifacts.rb --output Crashpad_Windows_build.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Crashpad_Windows_build_${{ github.sha }} | |
path: Crashpad_Windows_build.zip | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [arm64, x86_64] | |
generator: ["Unix Makefiles", Ninja] | |
steps: | |
# Install latest CMake. | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: CMake | |
run: | | |
mkdir cbuild | |
cmake -S . -B cbuild/ -DCRASHPAD_BUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -G "${{ matrix.generator }}" | |
cmake --build cbuild/ | |
- uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: ./backtrace/test | |
ruby-version: "3.1" | |
bundler-cache: true | |
- name: Crashpad distribution ZIP | |
run: | | |
ruby backtrace/save_artifacts.rb --output Crashpad_MacOs_build_${{ matrix.arch }}.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Crashpad_MacOs_build_${{ matrix.arch }}_${{ github.sha }} | |
path: Crashpad_MacOs_build_${{ matrix.arch }}.zip | |
build-android: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# supported are: armeabi-v7a, arm64-v8a, x86_64. x86 (32-bit) is NOT supported | |
abi: [armeabi-v7a, arm64-v8a, x86_64] | |
# 64 bit architectures will always have min API level 21 https://stackoverflow.com/a/56467008 | |
apiLevel: [21, 33] | |
ndk: [25.1.8937393] | |
include: | |
- apiLevel: 16 | |
abi: armeabi-v7a | |
ndk: 25.1.8937393 | |
steps: | |
# Install latest CMake. | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set env armeabi-v7a | |
if: ${{ matrix.abi == 'armeabi-v7a' }} | |
run: echo "SSL_MODE=NONE" >> $GITHUB_ENV | |
- name: Set env others | |
if: ${{ matrix.abi != 'armeabi-v7a' }} | |
run: echo "SSL_MODE=OPENSSL" >> $GITHUB_ENV | |
- name: Install NDK (optional) | |
# available on GitHub Actions host (as of 7/24/22) listed below | |
if: ${{ matrix.ndk }} != '21.4.7075529' && ${{ matrix.ndk }} != '23.2.8568313' && ${{ matrix.ndk }} != '24.0.8215888' | |
run: | | |
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ matrix.ndk }}" --sdk_root=${ANDROID_SDK_ROOT} | |
#ls -lsa $ANDROID_HOME/ndk/${{ matrix.ndk }}/platforms | |
- name: CMake | |
run: | | |
mkdir cbuild | |
cmake -S . -B cbuild/ -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk/${{ matrix.ndk }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} -DANDROID_PLATFORM=android-${{ matrix.apiLevel }} -DANDROID_NATIVE_API_LEVEL=${{ matrix.apiLevel }} -DANDROID_TOOLCHAIN=clang -DCRASHPAD_HTTPS_TRANSPORT=${{ env.SSL_MODE }} -DCRASHPAD_BUILD_EXAMPLES=TRUE | |
cmake --build cbuild/ | |
- name: Crashpad distribution ZIP | |
run: | | |
ruby backtrace/save_artifacts.rb --output Crashpad_Android_ndk${{ matrix.ndk }}_apiLevel${{ matrix.apiLevel }}_${{ matrix.abi }}_build.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Crashpad_Android_ndk${{ matrix.ndk }}_apiLevel${{ matrix.apiLevel }}_${{ matrix.abi }}_build_${{ github.sha }} | |
path: Crashpad_Android_ndk${{ matrix.ndk }}_apiLevel${{ matrix.apiLevel }}_${{ matrix.abi }}_build.zip |