Skip to content

Commit 6c86aa6

Browse files
committed
Add yaml defintions for CI tests with GitHub Actions
Initial tests check for ABI changes and build/test llvm, clang, and lld.
1 parent 3437c7f commit 6c86aa6

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.github/workflows/commit-tests.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Commit Tests
2+
3+
env:
4+
release_major: 9
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
build_llvm:
10+
name: check-all llvm/clang/lld
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os:
16+
- ubuntu-latest
17+
- windows-latest
18+
- macOS-latest
19+
steps:
20+
- name: Setup Windows
21+
if: startsWith(matrix.os, 'windows')
22+
uses: llvm/actions/setup-windows@master
23+
with:
24+
arch: amd64
25+
- name: Install Ninja
26+
uses: llvm/actions/install-ninja@master
27+
- uses: actions/checkout@v1
28+
with:
29+
fetch-depth: 1
30+
- name: Test LLVM
31+
uses: llvm/actions/build-test-llvm-project@master
32+
with:
33+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lld;" -DCMAKE_BUILD_TYPE=Release
34+
35+
abi-dump:
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
name:
40+
- build-baseline
41+
- build-latest
42+
include:
43+
- name: build-baseline
44+
# FIXME: Referencing the env context does not work here
45+
# ref: llvmorg-${{ env.release_major }}.0.0
46+
ref: llvmorg-9.0.0
47+
- name: build-latest
48+
ref: ${{ github.sha }}
49+
steps:
50+
- name: Install Ninja
51+
uses: llvm/actions/install-ninja@master
52+
- name: Install abi-compliance-checker
53+
run: sudo apt-get install abi-dumper
54+
- name: Download source code
55+
uses: llvm/actions/get-llvm-project-src@master
56+
with:
57+
ref: ${{ matrix.ref }}
58+
- name: Configure
59+
run: |
60+
mkdir build
61+
cd build
62+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON ../llvm
63+
- name: Build
64+
run: ninja -C build libLLVM-${{ env.release_major }}.so
65+
- name: Dump ABI
66+
run: abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers llvm/include -o ${{ matrix.ref }}.abi.tar.gz build/lib/libLLVM-${{ env.release_major }}.so
67+
- name: Upload ABI file
68+
uses: actions/upload-artifact@v1
69+
with:
70+
name: ${{ matrix.name }}
71+
path: ${{ matrix.ref }}.abi.tar.gz
72+
73+
abi-compare:
74+
runs-on: ubuntu-latest
75+
needs:
76+
- abi-dump
77+
steps:
78+
- name: Download baseline
79+
uses: actions/download-artifact@v1
80+
with:
81+
name: build-baseline
82+
- name: Download latest
83+
uses: actions/download-artifact@v1
84+
with:
85+
name: build-latest
86+
- name: Install abi-compliance-checker
87+
run: sudo apt-get install abi-compliance-checker
88+
- name: Compare ABI
89+
run: abi-compliance-checker -l libLLVM-${{ env.release_major}}.so -old build-baseline/*.tar.gz -new build-latest/*.tar.gz
90+
- name: Upload ABI Comparison
91+
if: always()
92+
uses: actions/upload-artifact@v1
93+
with:
94+
name: compat-report-${{ github.sha }}
95+
path: compat_reports/

0 commit comments

Comments
 (0)