WIP-1051 #31
This file contains hidden or 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: Build | |
on: | |
push: | |
branches: [ master, try ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
lldb_run_id: 18262797082 | |
rust_version: 1.89.0 | |
version_suffix: ${{ github.ref == 'refs/heads/master' && '' || '-' }} | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: Linux | |
image: ubuntu-latest | |
lldb_triple: x86_64-linux-gnu | |
rust_targets: x86_64-unknown-linux-gnu | |
platformid: linux-x64 | |
- os: Linux | |
image: ubuntu-latest | |
lldb_triple: aarch64-linux-gnu | |
rust_targets: aarch64-unknown-linux-gnu | |
platformid: linux-arm64 | |
cross: true | |
- os: Linux | |
image: ubuntu-latest | |
lldb_triple: arm-linux-gnueabihf | |
rust_targets: armv7-unknown-linux-gnueabihf | |
platformid: linux-armhf | |
cross: true | |
- os: MacOS | |
image: macOS-latest | |
lldb_triple: x86_64-apple-darwin | |
rust_targets: x86_64-apple-darwin | |
platformid: darwin-x64 | |
- os: MacOS | |
image: macOS-latest | |
lldb_triple: aarch64-apple-darwin | |
rust_targets: aarch64-apple-darwin | |
platformid: darwin-arm64 | |
- os: Windows | |
image: windows-latest | |
lldb_triple: x86_64-windows-msvc | |
rust_targets: x86_64-pc-windows-msvc x86_64-pc-windows-gnu | |
platformid: win32-x64 | |
name: ${{ matrix.os }} ${{ matrix.platformid }} | |
runs-on: ${{ matrix.image }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache Restore | |
id: cache_restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/ | |
~/.rustup/downloads/ | |
build/target/ | |
key: cargo-${{ runner.os }}-${{ matrix.platformid }}-${{ github.sha }} | |
restore-keys: | | |
cargo-${{ runner.os }}-${{ matrix.platformid }}- | |
- name: Install Rust | |
shell: bash | |
run: | | |
rustup default ${{ env.rust_version }} | |
rustup target add ${{ matrix.rust_targets }} | |
- name: Setup (Linux) | |
if: ${{ matrix.os == 'Linux' }} | |
run: | | |
mkdir -p $RUNNER_TEMP/clang | |
wget -q -O - https://github.com/vadimcn/lldb-build/releases/download/blobs/clang-15.tar.zst | zstd -dcf | tar -xf - -C $RUNNER_TEMP/clang | |
OLD_PATH=$(<$GITHUB_PATH) | |
echo "$RUNNER_TEMP/clang/bin" > $GITHUB_PATH | |
echo "$OLD_PATH" >> $GITHUB_PATH | |
mkdir -p $RUNNER_TEMP/sysroot | |
wget -q -O - https://github.com/vadimcn/lldb-build/releases/download/blobs/stretch-sysroot.tar.zst | zstd -dcf | tar -xf - -C $RUNNER_TEMP/sysroot | |
echo "CMAKE_SYSROOT=$RUNNER_TEMP/sysroot" >> $GITHUB_ENV | |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 & | |
echo "DISPLAY=:99.0" >> $GITHUB_ENV | |
- name: Setup (Windows) | |
if: ${{ matrix.os == 'Windows' }} | |
shell: cmd | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" || call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
set >> %GITHUB_ENV% | |
- name: Download LLDB | |
uses: actions/download-artifact@v5 | |
with: | |
repository: vadimcn/lldb-build | |
run-id: ${{ env.lldb_run_id }} | |
name: lldb--${{ matrix.lldb_triple }} | |
path: ${{ runner.temp }} | |
github-token: ${{ secrets.LLDB_BUILD_TOKEN }} | |
- name: Configure | |
shell: bash | |
run: | | |
mkdir -p build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_SYSROOT=$CMAKE_SYSROOT \ | |
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/toolchain-${{ matrix.lldb_triple }}.cmake \ | |
-DPLATFORM_ID=${{ matrix.platformId }} \ | |
-DVERSION_SUFFIX=${{ env.version_suffix }} \ | |
-DTEST_TIMEOUT=30000 \ | |
-DLLDB_PACKAGE=$RUNNER_TEMP/lldb--${{ matrix.lldb_triple }}.zip \ | |
-DCMAKE_VERBOSE_MAKEFILE=on \ | |
-GMake -B build -S . | |
cat build/CMakeCache.txt | |
- name: Build | |
shell: bash | |
run: | | |
cmake --build build --target vsix_full | |
- name: Test | |
shell: bash | |
run: | | |
cmake --build build --target check | |
- name: Cache save | |
uses: actions/cache/save@v4 | |
if: ${{ always() }} | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/ | |
~/.rustup/downloads/ | |
build/target/ | |
key: cargo-${{ runner.os }}-${{ matrix.platformid }}-${{ github.sha }} | |
- name: VSCode | |
uses: stateful/vscode-server-action@v1 | |
if: ${{ failure() && matrix.os == 'Linux' }} | |
with: | |
timeout: 300000 | |
permissions: | |
actions: read | |
contents: read |