Skip to content

Commit ddd8ca6

Browse files
committed
Import workflows from release/12.x branch
(cherry picked from commit 7546a34)
1 parent a6c3900 commit ddd8ca6

File tree

6 files changed

+518
-0
lines changed

6 files changed

+518
-0
lines changed

.github/workflows/clang-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Clang Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- 'llvm/**'
10+
- '.github/workflows/clang-tests.yml'
11+
pull_request:
12+
paths:
13+
- 'clang/**'
14+
- 'llvm/**'
15+
- '.github/workflows/clang-tests.yml'
16+
17+
jobs:
18+
build_clang:
19+
name: clang check-all
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os:
25+
- ubuntu-latest
26+
- windows-latest
27+
- macOS-latest
28+
steps:
29+
- name: Setup Windows
30+
if: startsWith(matrix.os, 'windows')
31+
uses: llvm/actions/setup-windows@main
32+
with:
33+
arch: amd64
34+
- name: Install Ninja
35+
uses: llvm/actions/install-ninja@main
36+
- uses: actions/checkout@v1
37+
with:
38+
fetch-depth: 250
39+
- name: Test clang
40+
uses: llvm/actions/build-test-llvm-project@main
41+
with:
42+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
43+
build_target: check-clang
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: libclang ABI Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- '.github/workflows/libclang-abi-tests.yml'
10+
pull_request:
11+
paths:
12+
- 'clang/**'
13+
- '.github/workflows/libclang-abi-tests.yml'
14+
15+
jobs:
16+
abi-dump-setup:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
20+
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
21+
ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }}
22+
BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
23+
BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
24+
LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
25+
LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
26+
LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
27+
steps:
28+
- name: Checkout source
29+
uses: actions/checkout@v1
30+
with:
31+
fetch-depth: 250
32+
33+
- name: Get LLVM version
34+
id: version
35+
uses: llvm/actions/get-llvm-version@main
36+
37+
- name: Setup Variables
38+
id: vars
39+
run: |
40+
minor_version=0
41+
remote_repo='https://github.com/llvm/llvm-project'
42+
if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 -o ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
43+
major_version=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))
44+
baseline_ref="llvmorg-$major_version.0.0"
45+
46+
# If there is a minor release, we want to use that as the base line.
47+
minor_ref=`git ls-remote --refs -t $remote_repo llvmorg-$major_version.[1-9].[0-9] | tail -n1 | grep -o 'llvmorg-.\+' || true`
48+
if [ -n "$minor_ref" ]; then
49+
baseline_ref=$minor_ref
50+
else
51+
# Check if we have a release candidate
52+
rc_ref=`git ls-remote --refs -t $remote_repo llvmorg-$major_version.[1-9].[0-9]-rc* | tail -n1 | grep -o 'llvmorg-.\+' || true`
53+
if [ -n "$rc_ref" ]; then
54+
baseline_ref=$rc_ref
55+
fi
56+
fi
57+
echo ::set-output name=BASELINE_VERSION_MAJOR::$major_version
58+
echo ::set-output name=BASELINE_REF::$baseline_ref
59+
echo ::set-output name=ABI_HEADERS::clang-c
60+
echo ::set-output name=ABI_LIBS::libclang.so
61+
else
62+
echo ::set-output name=BASELINE_VERSION_MAJOR::${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
63+
echo ::set-output name=BASELINE_REF::llvmorg-${{ steps.version.outputs.LLVM_VERSION_MAJOR }}.0.0
64+
echo ::set-output name=ABI_HEADERS::.
65+
echo ::set-output name=ABI_LIBS::libclang.so libclang-cpp.so
66+
fi
67+
68+
69+
abi-dump:
70+
needs: abi-dump-setup
71+
runs-on: ubuntu-latest
72+
strategy:
73+
matrix:
74+
name:
75+
- build-baseline
76+
- build-latest
77+
include:
78+
- name: build-baseline
79+
llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}
80+
ref: ${{ needs.abi-dump-setup.outputs.BASELINE_REF }}
81+
repo: llvm/llvm-project
82+
- name: build-latest
83+
llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }}
84+
ref: ${{ github.sha }}
85+
repo: ${{ github.repository }}
86+
steps:
87+
- name: Install Ninja
88+
uses: llvm/actions/install-ninja@main
89+
- name: Install abi-compliance-checker
90+
run: |
91+
sudo apt-get install abi-dumper autoconf pkg-config
92+
- name: Install universal-ctags
93+
run: |
94+
git clone https://github.com/universal-ctags/ctags.git
95+
cd ctags
96+
./autogen.sh
97+
./configure
98+
sudo make install
99+
- name: Download source code
100+
uses: llvm/actions/get-llvm-project-src@main
101+
with:
102+
ref: ${{ matrix.ref }}
103+
repo: ${{ matrix.repo }}
104+
- name: Configure
105+
run: |
106+
mkdir install
107+
cmake -B build -S llvm -G Ninja -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX=`pwd`/install llvm
108+
- name: Build
109+
run: ninja -C build/ ${{ needs.abi-dump-setup.outputs.ABI_LIBS }} install-clang-headers
110+
- name: Dump ABI
111+
run: |
112+
parallel abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o {}-${{ matrix.ref }}.abi ./build/lib/{} ::: ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}
113+
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do
114+
# Remove symbol versioning from dumps, so we can compare across major versions.
115+
sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' $lib-${{ matrix.ref }}.abi
116+
done
117+
- name: Upload ABI file
118+
uses: actions/upload-artifact@v2
119+
with:
120+
name: ${{ matrix.name }}
121+
path: "*${{ matrix.ref }}.abi"
122+
123+
abi-compare:
124+
runs-on: ubuntu-latest
125+
needs:
126+
- abi-dump-setup
127+
- abi-dump
128+
steps:
129+
- name: Download baseline
130+
uses: actions/download-artifact@v1
131+
with:
132+
name: build-baseline
133+
- name: Download latest
134+
uses: actions/download-artifact@v1
135+
with:
136+
name: build-latest
137+
138+
- name: Install abi-compliance-checker
139+
run: sudo apt-get install abi-compliance-checker
140+
- name: Compare ABI
141+
run: |
142+
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do
143+
abi-compliance-checker -lib $lib -old build-baseline/$lib*.abi -new build-latest/$lib*.abi
144+
done
145+
- name: Upload ABI Comparison
146+
if: always()
147+
uses: actions/upload-artifact@v2
148+
with:
149+
name: compat-report-${{ github.sha }}
150+
path: compat_reports/
151+

.github/workflows/libclc-tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: libclc Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- 'llvm/**'
10+
- 'libclc/**'
11+
- '.github/workflows/libclc-tests.yml'
12+
pull_request:
13+
paths:
14+
- 'clang/**'
15+
- 'llvm/**'
16+
- 'libclc/**'
17+
- '.github/workflows/libclc-tests.yml'
18+
19+
jobs:
20+
build_libclc:
21+
name: libclc test
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
# Disable build on windows, because I can't figure out where llvm-config is.
29+
#- windows-latest
30+
- macOS-latest
31+
steps:
32+
- name: Setup Windows
33+
if: startsWith(matrix.os, 'windows')
34+
uses: llvm/actions/setup-windows@main
35+
with:
36+
arch: amd64
37+
- name: Install Ninja
38+
uses: llvm/actions/install-ninja@main
39+
- uses: actions/checkout@v1
40+
with:
41+
fetch-depth: 250
42+
- name: Build clang
43+
uses: llvm/actions/build-test-llvm-project@main
44+
with:
45+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
46+
build_target: ""
47+
- name: Build and test libclc
48+
# spirv targets require llvm-spirv, so skip building them until we figure out
49+
# how to install this tool.
50+
run: |
51+
cmake -G Ninja -S libclc -B libclc-build -DLLVM_CONFIG=`pwd`/build/bin/llvm-config -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
52+
ninja -C libclc-build
53+
ninja -C libclc-build test

.github/workflows/lld-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: LLD Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'lld/**'
9+
- 'llvm/**'
10+
- '.github/workflows/lld-tests.yml'
11+
pull_request:
12+
paths:
13+
- 'lld/**'
14+
- 'llvm/**'
15+
- '.github/workflows/lld-tests.yml'
16+
17+
jobs:
18+
build_lld:
19+
name: lld check-all
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os:
25+
- ubuntu-latest
26+
- windows-latest
27+
- macOS-latest
28+
steps:
29+
- name: Setup Windows
30+
if: startsWith(matrix.os, 'windows')
31+
uses: llvm/actions/setup-windows@main
32+
with:
33+
arch: amd64
34+
- name: Install Ninja
35+
uses: llvm/actions/install-ninja@main
36+
- uses: actions/checkout@v1
37+
with:
38+
fetch-depth: 250
39+
- name: Test lld
40+
uses: llvm/actions/build-test-llvm-project@main
41+
with:
42+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="lld" -DCMAKE_BUILD_TYPE=Release
43+
build_target: check-lld

.github/workflows/lldb-tests.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: lldb Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- 'llvm/**'
10+
- 'lldb/**'
11+
- '.github/workflows/lldb-tests.yml'
12+
pull_request:
13+
paths:
14+
- 'clang/**'
15+
- 'llvm/**'
16+
- 'lldb/**'
17+
- '.github/workflows/lldb-tests.yml'
18+
19+
jobs:
20+
build_lldb:
21+
name: lldb build
22+
runs-on: ${{ matrix.os }}
23+
# Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274
24+
env:
25+
CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os:
30+
- ubuntu-latest
31+
- windows-latest
32+
- macOS-latest
33+
steps:
34+
- name: Setup Windows
35+
if: startsWith(matrix.os, 'windows')
36+
uses: llvm/actions/setup-windows@main
37+
with:
38+
arch: amd64
39+
- name: Install Ninja
40+
uses: llvm/actions/install-ninja@main
41+
- uses: actions/checkout@v1
42+
with:
43+
fetch-depth: 250
44+
- name: Build lldb
45+
uses: llvm/actions/build-test-llvm-project@main
46+
with:
47+
# Mac OS requries that libcxx is enabled for lldb tests, so we need to disable them.
48+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF
49+
# check-lldb is not consistent, so we only build lldb.
50+
build_target: ""

0 commit comments

Comments
 (0)