[llvm] Use container on Linux to run llvm-project-tests workflow (PR #81349)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 9 21:02:35 PST 2024
https://github.com/tstellar created https://github.com/llvm/llvm-project/pull/81349
None
>From fb50c28172dbf88bdc4a0e8abc0276b417744f5b Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 7 Feb 2024 17:42:07 -0800
Subject: [PATCH] Use container on Linux to run llvm-project-tests workflow
---
.github/workflows/llvm-project-tests.yml | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml
index 68b4a68d1af984..228ac0276861bf 100644
--- a/.github/workflows/llvm-project-tests.yml
+++ b/.github/workflows/llvm-project-tests.yml
@@ -58,6 +58,10 @@ jobs:
lit-tests:
name: Lit Tests
runs-on: ${{ matrix.os }}
+ container:
+ image: ${{(startsWith(matrix.os, 'ubuntu') && format('ghcr.io/{0}/ci-ubuntu-22.04:latest', github.repository_owner)) || null}}
+ volumes:
+ - /mnt/:/mnt/
strategy:
fail-fast: false
matrix:
@@ -77,6 +81,7 @@ jobs:
with:
python-version: ${{ inputs.python_version }}
- name: Install Ninja
+ if: runner.os != 'Linux'
uses: llvm/actions/install-ninja at 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
@@ -108,8 +113,8 @@ jobs:
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
builddir="/mnt/build/"
- sudo mkdir -p $builddir
- sudo chown `whoami`:`whoami` $builddir
+ mkdir -p $builddir
+ extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
else
builddir="$(pwd)"/build
fi
@@ -123,6 +128,7 @@ jobs:
-DLLDB_INCLUDE_TESTS=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
+ $extra_cmake_args \
${{ inputs.extra_cmake_args }}
ninja -C "$builddir" '${{ inputs.build_target }}'
More information about the llvm-commits
mailing list