Skip to content

Commit

Permalink
try adding builders
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWF committed Aug 5, 2024
1 parent 42aede0 commit 7b2d493
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 91 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ericwf-contracts-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: EricWF Contracts Nightly Release flow

permissions:
contents: write


on:
workflow_dispatch:
push:
branches:
- 'eric-contracts'
paths:
- 'clang/**'
- 'libcxx/**'
- '!llvm/**'

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
check_clang:
if: github.repository_owner == 'efcs'
name: Test clang
uses: ./.github/workflows/llvm-project-tests.yml
with:
build_target: check-clang
projects: clang
runtimes: 'libcxx;libcxxabi;libunwind'
122 changes: 31 additions & 91 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ on:
required: false
projects:
required: false
extra_cmake_args:
required: false
os_list:
runtimes:
required: false
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
python_version:
extra_cmake_args:
required: false
type: string
default: '3.11'
workflow_call:
inputs:
build_target:
Expand All @@ -29,22 +24,14 @@ on:
projects:
required: true
type: string

extra_cmake_args:
runtimes:
required: false
type: string

os_list:
extra_cmake_args:
required: false
type: string
# Use windows-2019 due to:
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'

python_version:
required: false
type: string
default: '3.11'

concurrency:
# Skip intermediate builds: always.
Expand All @@ -57,93 +44,46 @@ concurrency:
jobs:
lit-tests:
name: Lit Tests
runs-on: ${{ matrix.os }}
container:
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
volumes:
- /mnt/:/mnt/
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(inputs.os_list) }}
runs-on: aah
steps:
- name: Setup Windows
if: startsWith(matrix.os, 'windows')
uses: llvm/actions/setup-windows@main
with:
arch: amd64
# On Windows, starting with win19/20220814.1, cmake choose the 32-bit
# python3.10.6 libraries instead of the 64-bit libraries when building
# lldb. Using this setup-python action to make 3.10 the default
# python fixes this.
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Install Ninja
if: runner.os != 'Linux'
uses: llvm/actions/install-ninja@main
# actions/checkout deletes any existing files in the new git directory,
# so this needs to either run before ccache-action or it has to use
# clean: false.
- uses: actions/checkout@v4
with:
fetch-depth: 250
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
# A full build of llvm, clang, lld, and lldb takes about 250MB
# of ccache space. There's not much reason to have more than this,
# because we usually won't need to save cache entries from older
# builds. Also, there is an overall 10GB cache limit, and each
# run creates a new cache entry so we want to ensure that we have
# enough cache space for all the tests to run at once and still
# fit under the 10 GB limit.
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
max-size: 2G
key: ${{ matrix.os }}
variant: sccache
- name: Build and Test
env:
# Workaround for https://github.com/actions/virtual-environments/issues/5900.
# This should be a no-op for non-mac OSes
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
shell: bash
id: build-llvm
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
builddir="/mnt/build/"
mkdir -p $builddir
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
else
builddir="$(pwd)"/build
fi
if [ "${{ runner.os }}" == "macOS" ]; then
# Workaround test failure on some lld tests on MacOS
# https://github.com/llvm/llvm-project/issues/81967
extra_cmake_args="-DLLVM_DISABLE_ASSEMBLY_FILES=ON"
fi
builddir="/home/runner/build"
mkdir -p $builddir
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT"
cmake -G Ninja \
-B "$builddir" \
-S llvm \
-DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RUNTIMES="${{ inputs.runtimes }}" \
-DCMAKE_BUILD_TYPE=DEBUG \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLDB_INCLUDE_TESTS=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
$extra_cmake_args \
-DLLVM_USE_SANITIZER=Undefined \
-DCMAKE_CXX_FLAGS="-gline-tables-only -O1" \
-DCMAKE_C_FLAGS="-gline-tables-only -O1" \
-DLLVM_USE_LINKER=mold \
$extra_cmake_args \
${{ inputs.extra_cmake_args }}
ninja -C "$builddir" '${{ inputs.build_target }}'
- name: Build and Test libclc
if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')"
env:
LLVM_BUILDDIR: ${{ steps.build-llvm.outputs.llvm-builddir }}
- name: Test Clang
shell: bash
run: |
builddir=$(grep llvm-builddir "$GITHUB_OUTPUT" | cut -d= -f2)
ninja -C "$builddir" check-clang
- name: Test libc++
shell: bash
run: |
# Make sure all of LLVM libraries that llvm-config needs are built.
ninja -C "$LLVM_BUILDDIR"
cmake -G Ninja -S libclc -B libclc-build -DLLVM_DIR="$LLVM_BUILDDIR"/lib/cmake/llvm -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
ninja -C libclc-build
ninja -C libclc-build test
builddir=$(grep llvm-builddir "$GITHUB_OUTPUT" | cut -d= -f2)
ninja -C "$builddir" check-cxx



0 comments on commit 7b2d493

Please sign in to comment.