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'
32 name: Test llvm,clang,libclc
33 uses: ./.github/workflows/llvm-project-tests.yml
35 build_target: check-all
36 projects: clang;libclc
38 # These need to be separate from the check_all job, becuase there is not enough disk
39 # space to build all these projects on Windows.
41 if: github.repository_owner == 'llvm'
43 uses: ./.github/workflows/llvm-project-tests.yml
49 if: github.repository_owner == 'llvm'
51 uses: ./.github/workflows/llvm-project-tests.yml
53 build_target: check-lld
57 if: github.repository_owner == 'llvm'
58 runs-on: ubuntu-latest
60 BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
61 ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
62 BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }}
63 LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }}
64 LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }}
65 LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }}
67 - name: Checkout source
68 uses: actions/checkout@v4
72 - name: Get LLVM version
74 uses: llvm/actions/get-llvm-version@main
76 - name: Setup Variables
79 if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 ] || [ ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then
81 echo "BASELINE_VERSION_MAJOR=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1))"
82 echo "ABI_HEADERS=llvm-c"
86 echo "BASELINE_VERSION_MAJOR=${{ steps.version.outputs.LLVM_VERSION_MAJOR }}"
92 if: github.repository_owner == 'llvm'
94 runs-on: ubuntu-latest
101 - name: build-baseline
102 llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}
103 ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.0.0
104 repo: llvm/llvm-project
106 llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }}
107 ref: ${{ github.sha }}
108 repo: ${{ github.repository }}
110 - name: Install Ninja
111 uses: llvm/actions/install-ninja@main
112 - name: Install abi-compliance-checker
114 sudo apt-get install abi-dumper autoconf pkg-config
115 - name: Install universal-ctags
117 git clone https://github.com/universal-ctags/ctags.git
122 - name: Download source code
123 uses: llvm/actions/get-llvm-project-src@main
125 ref: ${{ matrix.ref }}
126 repo: ${{ matrix.repo }}
130 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
132 # Need to run install-LLVM twice to ensure the symlink is installed (this is a bug).
134 ninja -C build install-LLVM
135 ninja -C build install-LLVM
136 ninja -C build install-llvm-headers
139 if [ "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" ]; then
140 nm ./install/lib/libLLVM.so | awk "/T _LLVM/ || /T LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" | cut -d ' ' -f 3 > llvm.symbols
141 # 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.
142 export EXTRA_ARGS="-symbols-list llvm.symbols"
146 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
147 # Remove symbol versioning from dumps, so we can compare across major versions.
148 sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi
149 - name: Upload ABI file
150 uses: actions/upload-artifact@v3
152 name: ${{ matrix.name }}
153 path: ${{ matrix.ref }}.abi
155 - name: Upload symbol list file
156 if: matrix.name == 'build-baseline'
157 uses: actions/upload-artifact@v3
163 if: github.repository_owner == 'llvm'
164 runs-on: ubuntu-latest
169 - name: Download baseline
170 uses: actions/download-artifact@v3
174 - name: Download latest
175 uses: actions/download-artifact@v3
179 - name: Download symbol list
180 uses: actions/download-artifact@v3
185 - name: Install abi-compliance-checker
186 run: sudo apt-get install abi-compliance-checker
189 if [ -s symbol-list/llvm.symbols ]; then
190 # This option doesn't seem to work with the ABI dumper, so passing it here.
191 export EXTRA_ARGS="-symbols-list symbol-list/llvm.symbols"
193 # FIXME: Reading of gzip'd abi files on the GitHub runners stop
194 # working some time in March of 2021, likely due to a change in the
195 # runner's environment.
196 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"
197 - name: Upload ABI Comparison
199 uses: actions/upload-artifact@v3
201 name: compat-report-${{ github.sha }}
202 path: compat_reports/