Skip to content

Commit e2cba65

Browse files
committed
Import workflows from release/13.x branch
1 parent 8d3c673 commit e2cba65

File tree

6 files changed

+558
-0
lines changed

6 files changed

+558
-0
lines changed

.github/workflows/clang-tests.yml

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

.github/workflows/libclc-tests.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
concurrency:
20+
# Skip intermediate builds: always.
21+
# Cancel intermediate builds: only if it is a pull request build.
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
24+
25+
26+
jobs:
27+
build_libclc:
28+
name: libclc test
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os:
34+
- ubuntu-latest
35+
# Disable build on windows, because I can't figure out where llvm-config is.
36+
#- windows-latest
37+
- macOS-latest
38+
steps:
39+
- name: Setup Windows
40+
if: startsWith(matrix.os, 'windows')
41+
uses: llvm/actions/setup-windows@main
42+
with:
43+
arch: amd64
44+
- name: Install Ninja
45+
uses: llvm/actions/install-ninja@main
46+
- uses: actions/checkout@v1
47+
with:
48+
fetch-depth: 250
49+
- name: Build clang
50+
uses: llvm/actions/build-test-llvm-project@main
51+
with:
52+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
53+
build_target: ""
54+
- name: Build and test libclc
55+
# spirv targets require llvm-spirv, so skip building them until we figure out
56+
# how to install this tool.
57+
run: |
58+
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"
59+
ninja -C libclc-build
60+
ninja -C libclc-build test

.github/workflows/lld-tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
concurrency:
18+
# Skip intermediate builds: always.
19+
# Cancel intermediate builds: only if it is a pull request build.
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
22+
23+
jobs:
24+
build_lld:
25+
name: lld check-all
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os:
31+
- ubuntu-latest
32+
- windows-latest
33+
- macOS-latest
34+
steps:
35+
- name: Setup Windows
36+
if: startsWith(matrix.os, 'windows')
37+
uses: llvm/actions/setup-windows@main
38+
with:
39+
arch: amd64
40+
- name: Install Ninja
41+
uses: llvm/actions/install-ninja@main
42+
- uses: actions/checkout@v1
43+
with:
44+
fetch-depth: 250
45+
- name: Test lld
46+
uses: llvm/actions/build-test-llvm-project@main
47+
with:
48+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="lld" -DCMAKE_BUILD_TYPE=Release
49+
build_target: check-lld

.github/workflows/lldb-tests.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
concurrency:
20+
# Skip intermediate builds: always.
21+
# Cancel intermediate builds: only if it is a pull request build.
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
24+
25+
26+
jobs:
27+
build_lldb:
28+
name: lldb build
29+
runs-on: ${{ matrix.os }}
30+
# Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274
31+
env:
32+
CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os:
37+
- ubuntu-latest
38+
- windows-latest
39+
- macOS-10.15
40+
steps:
41+
- name: Setup Windows
42+
if: startsWith(matrix.os, 'windows')
43+
uses: llvm/actions/setup-windows@main
44+
with:
45+
arch: amd64
46+
- name: Install Ninja
47+
uses: llvm/actions/install-ninja@main
48+
- uses: actions/checkout@v1
49+
with:
50+
fetch-depth: 250
51+
- name: Build lldb
52+
uses: llvm/actions/build-test-llvm-project@main
53+
with:
54+
# Mac OS requries that libcxx is enabled for lldb tests, so we need to disable them.
55+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF
56+
# check-lldb is not consistent, so we only build lldb.
57+
build_target: ""

0 commit comments

Comments
 (0)