Skip to content

Update build-and-test-template.yml #16

Update build-and-test-template.yml

Update build-and-test-template.yml #16

name: Build LLVM assert
on:
pull_request:
push:
workflow_dispatch:
inputs:
LLVM_VERSION:
description: 'LLVM sha to build'
required: false
type: string
save_cache:
required: true
type: boolean
default: false
schedule:
- cron: '0 */8 * * *'
jobs:
fetch_llvm_version:
runs-on: ubuntu-latest
outputs:
LLVM_VERSION: ${{ steps.fetch.outputs.LLVM_VERSION }}
LLVM_VERSION_MAJOR: ${{ steps.fetch.outputs.LLVM_VERSION_MAJOR }}
env:
LLVM_VERSION: '23a26e7120df474f37f7369e8e06fd90f21a58b5' # ${{ github.event.inputs.LLVM_VERSION }}
steps:
- name: "Fetch"
id: fetch
run: |
set -o xtrace
if [ -z "$LLVM_VERSION" ]; then
LLVM_VERSION=$(git ls-remote https://github.com/llvm/llvm-project.git | grep 'refs/heads/main$' | awk '{print $1}')
fi
LLVM_VERSION_MAJOR=$(curl -s https://raw.githubusercontent.com/llvm/llvm-project/$LLVM_VERSION/cmake/Modules/LLVMVersion.cmake | grep 'set(LLVM_VERSION_MAJOR' | awk '{print $2}' | tr -d ')')
echo "LLVM_VERSION=$LLVM_VERSION" >> "$GITHUB_OUTPUT"
echo "LLVM_VERSION_MAJOR=$LLVM_VERSION_MAJOR" >> "$GITHUB_OUTPUT"
build:
needs: fetch_llvm_version
strategy:
fail-fast: false
matrix:
target:
- x86_64-w64-mingw32-cxx11
- aarch64-apple-darwin
- i686-w64-mingw32-cxx11
uses: ./.github/workflows/build-and-test-template.yml
with:
target: ${{ matrix.target }}
LLVM_VERSION: ${{ needs.fetch_llvm_version.outputs.LLVM_VERSION }}
LLVM_VERSION_MAJOR: ${{ needs.fetch_llvm_version.outputs.LLVM_VERSION_MAJOR }}
save_cache: ${{ github.ref == 'refs/heads/master' && github.event.inputs.LLVM_VERSION == '' }}