|
| 1 | +--- |
| 2 | +name: Clang Build Analysis |
| 3 | + |
| 4 | +on: workflow_dispatch |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + timeout-minutes: 5 |
| 10 | + steps: |
| 11 | + |
| 12 | + - name: Checkout Repository |
| 13 | + uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: Checkout ClangBuildAnalyzer |
| 16 | + uses: actions/checkout@v2 |
| 17 | + with: |
| 18 | + repository: aras-p/ClangBuildAnalyzer |
| 19 | + path: analyzer |
| 20 | + |
| 21 | + - name: Setup Ubuntu |
| 22 | + shell: bash |
| 23 | + run: | |
| 24 | + sudo apt install antlr libantlr-dev libantlr-java libarchive-dev \ |
| 25 | + libcurl4-openssl-dev libxml2-utils libxslt1-dev \ |
| 26 | + ninja-build |
| 27 | + curl -L http://www.sdml.cs.kent.edu/build/srcML-1.0.0-Boost.tar.gz | \ |
| 28 | + sudo tar xz -C /usr/local/include |
| 29 | +
|
| 30 | + - name: Build ClangBuildAnalyzer |
| 31 | + working-directory: analyzer |
| 32 | + run: | |
| 33 | + mkdir build |
| 34 | + cd build |
| 35 | + cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja |
| 36 | + ninja |
| 37 | + echo ":/Users/runner/work/srcML/srcML/analyzer/build" >> $GITHUB_PATH |
| 38 | +
|
| 39 | + - name: Create build directory |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + mkdir build |
| 43 | +
|
| 44 | + - name: CMake Setup PCH On |
| 45 | + shell: bash |
| 46 | + working-directory: build |
| 47 | + run: | |
| 48 | + export CC=/usr/bin/clang |
| 49 | + export CXX=/usr/bin/clang++ |
| 50 | + cmake .. -G Ninja -DCLANG_TIME_TRACE=ON -DSRCML_BUILD_USEPCH=ON |
| 51 | +
|
| 52 | + - name: Build |
| 53 | + shell: bash |
| 54 | + working-directory: build |
| 55 | + run: | |
| 56 | + cmake --build . --config Release |
| 57 | +
|
| 58 | + - name: Analyze |
| 59 | + shell: bash |
| 60 | + working-directory: build |
| 61 | + run: | |
| 62 | + ClangBuildAnalyzer --all src/parser capture_pch_parser |
| 63 | + ClangBuildAnalyzer --analyze capture_pch_parser > capture_pch_parser.txt |
| 64 | + ClangBuildAnalyzer --all src/libsrcml capture_pch_libsrcml |
| 65 | + ClangBuildAnalyzer --analyze capture_pch_libsrcml > capture_pch_libsrcml.txt |
| 66 | + ClangBuildAnalyzer --all src/client capture_pch_client |
| 67 | + ClangBuildAnalyzer --analyze capture_pch_client > capture_pch_client.txt |
| 68 | + ClangBuildAnalyzer --all . capture_pch |
| 69 | + ClangBuildAnalyzer --analyze capture_pch > capture_pch.txt |
| 70 | +
|
| 71 | + - name: CMake Setup PCH Off |
| 72 | + shell: bash |
| 73 | + working-directory: build |
| 74 | + run: | |
| 75 | + cmake .. -G Ninja -DCLANG_TIME_TRACE=ON -DSRCML_BUILD_USEPCH=OFF |
| 76 | + cmake --build . --config Release --target clean |
| 77 | +
|
| 78 | + - name: Build |
| 79 | + shell: bash |
| 80 | + working-directory: build |
| 81 | + run: | |
| 82 | + cmake --build . --config Release |
| 83 | +
|
| 84 | + - name: Analyze |
| 85 | + shell: bash |
| 86 | + working-directory: build |
| 87 | + run: | |
| 88 | + ClangBuildAnalyzer --all src/parser capture_nopch_parser |
| 89 | + ClangBuildAnalyzer --analyze capture_nopch_parser > capture_nopch_parser.txt |
| 90 | + ClangBuildAnalyzer --all src/libsrcml capture_nopch_libsrcml |
| 91 | + ClangBuildAnalyzer --analyze capture_nopch_libsrcml > capture_nopch_libsrcml.txt |
| 92 | + ClangBuildAnalyzer --all src/client capture_nopch_client |
| 93 | + ClangBuildAnalyzer --analyze capture_nopch_client > capture_nopch_client.txt |
| 94 | + ClangBuildAnalyzer --all . capture_nopch |
| 95 | + ClangBuildAnalyzer --analyze capture_nopch > capture_nopch.txt |
| 96 | +
|
| 97 | + - uses: actions/upload-artifact@v2 |
| 98 | + with: |
| 99 | + name: Capture |
| 100 | + path: build/capture* |
0 commit comments