13 - '.github/workflows/llvm-tests.yml'
14 - '.github/workflows/llvm-project-tests.yml'
20 - '.github/workflows/llvm-tests.yml'
21 - '.github/workflows/llvm-project-tests.yml'
24 # Skip intermediate builds: always.
25 # Cancel intermediate builds: only if it is a pull request build.
26 group: ${{ github.workflow }}-${{ github.ref }}
27 cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
31 if: github.repository_owner == 'llvm'
33 uses: ./.github/workflows/llvm-project-tests.yml
35 build_target: check-all
36 projects: clang;lld;libclc;lldb
39 if: github.repository_owner == 'llvm'
40 runs-on: ubuntu-latest
42 BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
43 ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
44 BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
45 BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }}
46 LLVM_VERSION_MAJOR: ${{ steps.version.outputs.major }}
47 LLVM_VERSION_MINOR: ${{ steps.version.outputs.minor }}
48 LLVM_VERSION_PATCH: ${{ steps.version.outputs.patch }}
50 - name: Checkout source
51 uses: actions/checkout@v4
55 - name: Get LLVM version
57 uses: ./.github/workflows/get-llvm-version
59 - name: Setup Variables
63 # 18.1.0 we aren't doing ABI checks.
64 # 18.1.1 We want to check 18.1.0.
66 # 18.1.0 We want to check 17.0.x
67 # 18.1.1 We want to check 18.1.0
68 echo "BASELINE_VERSION_MINOR=1" >> "$GITHUB_OUTPUT"
69 if [ ${{ steps.version.outputs.patch }} -eq 0 ]; then
71 echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.major }} - 1))"
72 echo "ABI_HEADERS=llvm-c"
76 echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.major }}"
82 if: github.repository_owner == 'llvm'
84 runs-on: ubuntu-latest
91 - name: build-baseline
92 llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}
93 ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MINOR }}.0
94 repo: llvm/llvm-project
96 llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }}
97 ref: ${{ github.sha }}
98 repo: ${{ github.repository }}
100 - name: Install Ninja
101 uses: llvm/actions/install-ninja@main
102 - name: Install abi-compliance-checker
104 sudo apt-get install abi-dumper autoconf pkg-config
105 - name: Install universal-ctags
107 git clone https://github.com/universal-ctags/ctags.git
112 - name: Download source code
113 uses: llvm/actions/get-llvm-project-src@main
115 ref: ${{ matrix.ref }}
116 repo: ${{ matrix.repo }}
120 cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX="$(pwd)"/install llvm
122 # Need to run install-LLVM twice to ensure the symlink is installed (this is a bug).
124 ninja -C build install-LLVM
125 ninja -C build install-LLVM
126 ninja -C build install-llvm-headers
129 if [ "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" ]; then
130 nm ./install/lib/libLLVM.so | awk "/T _LLVM/ || /T LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" | cut -d ' ' -f 3 > llvm.symbols
131 # Even though the -symbols-list option doesn't seem to filter out the symbols, I believe it speeds up processing, so I'm leaving it in.
132 export EXTRA_ARGS="-symbols-list llvm.symbols"
136 abi-dumper $EXTRA_ARGS -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o ${{ matrix.ref }}.abi ./install/lib/libLLVM.so
137 # Remove symbol versioning from dumps, so we can compare across major versions.
138 sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi
139 - name: Upload ABI file
140 uses: actions/upload-artifact@v3
142 name: ${{ matrix.name }}
143 path: ${{ matrix.ref }}.abi
145 - name: Upload symbol list file
146 if: matrix.name == 'build-baseline'
147 uses: actions/upload-artifact@v3
153 if: github.repository_owner == 'llvm'
154 runs-on: ubuntu-latest
159 - name: Download baseline
160 uses: actions/download-artifact@v3
164 - name: Download latest
165 uses: actions/download-artifact@v3
169 - name: Download symbol list
170 uses: actions/download-artifact@v3
175 - name: Install abi-compliance-checker
176 run: sudo apt-get install abi-compliance-checker
179 if [ -s symbol-list/llvm.symbols ]; then
180 # This option doesn't seem to work with the ABI dumper, so passing it here.
181 export EXTRA_ARGS="-symbols-list symbol-list/llvm.symbols"
183 # FIXME: Reading of gzip'd abi files on the GitHub runners stop
184 # working some time in March of 2021, likely due to a change in the
185 # runner's environment.
186 abi-compliance-checker $EXTRA_ARGS -l libLLVM.so -old build-baseline/*.abi -new build-latest/*.abi || test "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c"
187 - name: Upload ABI Comparison
189 uses: actions/upload-artifact@v3
191 name: compat-report-${{ github.sha }}
192 path: compat_reports/