blob: 06f5fcc04c8718f80b5d96966a7354c86e8bfd08 [file] [log] [blame]
name: Build & Test
on:
push:
branches:
- master
pull_request:
jobs:
build-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
llvm_version: 10
- os: ubuntu-latest
llvm_version: 11
- os: windows-latest
llvm_version: 11
llvm_archive: llvm-11.0.0-x86_64-windows-msvc-release-md
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Get Bazel cache dir
id: bazel-cache
run: |
echo "::set-output name=bazel-cache-dir::$(bazel info output_base)"
- name: Mount Bazel cache
uses: actions/cache@v2
with:
path: |
${{ steps.bazel-cache.outputs.bazel-cache-dir }}
!${{ steps.bazel-cache.outputs.bazel-cache-dir }}/java.log.*
key: ${{ runner.os }}-bazel-${{ matrix.llvm_version }}
- name: Setup LLVM (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh ${{ matrix.llvm_version }}
sudo apt install -y llvm-${{ matrix.llvm_version }}-dev libclang-${{ matrix.llvm_version }}-dev liblldb-${{ matrix.llvm_version }}-dev
echo "LLVM_INSTALL_PATH=/usr/lib/llvm-${{ matrix.llvm_version }}" >> $GITHUB_ENV
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
- name: Setup LLVM (Windows)
if: matrix.os == 'windows-latest'
run: |
C:\msys64\usr\bin\wget.exe -q "https://github.com/google/lldb-eval/releases/download/llvm-11/${{ matrix.llvm_archive }}.7z"
7z x -y "${{ matrix.llvm_archive }}.7z"
echo "LLVM_INSTALL_PATH=$pwd/${{ matrix.llvm_archive }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
C:\msys64\usr\bin\wget.exe -q "https://github.com/microsoft/STL/files/5453503/GH-1300.diff.txt"
git apply --unsafe-paths -p6 --directory="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include" "GH-1300.diff.txt"
- name: Build
run: bazel build ...:all
- name: Test
run: bazel test --test_output=errors ...:all
- name: Shutdown
run: bazel shutdown