|
| 1 | +name: Build LLVM Artifacts |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ github-workflows ] |
| 6 | + |
| 7 | +env: |
| 8 | + CCACHE_BASEDIR: $GITHUB_WORKSPACE |
| 9 | + CCACHE_DIR: $GITHUB_WORKSPACE/.ccache |
| 10 | + CCACHE_COMPRESS: true |
| 11 | + CCACHE_COMPRESSLEVEL: 6 |
| 12 | + |
| 13 | +jobs: |
| 14 | + update-release-tag: |
| 15 | + runs-on: ubuntu-20.04 |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: marvinpinto/action-automatic-releases@1369002240ebd4f758bbc69e9ae3649a5c3c2e14 |
| 19 | + with: |
| 20 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + automatic_release_tag: optsched-artifacts |
| 22 | + prerelease: false |
| 23 | + |
| 24 | + build-normal-llvm: |
| 25 | + needs: update-release-tag |
| 26 | + |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + llvm: [9, 10, 11, 12, 13] |
| 30 | + os: [ubuntu-20.04] |
| 31 | + artifact-tag: [stock-release-asserts] |
| 32 | + |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + with: |
| 38 | + repository: llvm/llvm-project |
| 39 | + ref: release/${{ matrix.llvm }}.x |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + run: | |
| 43 | + sudo apt-get install ninja-build |
| 44 | + sudo apt-get install ccache |
| 45 | +
|
| 46 | + - name: Set up ccache |
| 47 | + uses: actions/cache@v2 |
| 48 | + with: |
| 49 | + path: .ccache |
| 50 | + key: ccache-${{ matrix.asserts }}-${{ matrix.artifact-tag }} |
| 51 | + |
| 52 | + - name: Configure |
| 53 | + run: | |
| 54 | + mkdir build && cd build |
| 55 | + cmake ../llvm -GNinja \ |
| 56 | + -DCMAKE_BUILD_TYPE=Release \ |
| 57 | + -DCMAKE_PARALLEL_LINK_JOBS=1 \ |
| 58 | + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
| 59 | + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ |
| 60 | + -DCMAKE_INSTALL_PREFIX=$(cd ..; pwd)/install \ |
| 61 | + -DLLVM_ENABLE_PROJECTS='clang' \ |
| 62 | + '-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU' \ |
| 63 | + -DLLVM_INCLUDE_TESTS=ON \ |
| 64 | + -DLLVM_OPTIMIZED_TABLEGEN=ON \ |
| 65 | + -DLLVM_ENABLE_ASSERTIONS=${{ matrix.asserts }} |
| 66 | +
|
| 67 | + - name: Build |
| 68 | + working-directory: build |
| 69 | + run: | |
| 70 | + ninja || true |
| 71 | + ninja || true |
| 72 | + ninja || true |
| 73 | + ninja || true |
| 74 | + ninja |
| 75 | +
|
| 76 | + - name: Install |
| 77 | + working-directory: build |
| 78 | + run: | |
| 79 | + ninja install |
| 80 | +
|
| 81 | + - name: Copy Private Headers |
| 82 | + run: | |
| 83 | + mkdir -p install/include/private |
| 84 | + cp llvm/lib/Target/AMDGPU/*.h install/include/private |
| 85 | + cp build/lib/Target/AMDGPU/*.inc install/include/private |
| 86 | +
|
| 87 | + - name: Build artifact |
| 88 | + run: | |
| 89 | + tar -czf llvm-${{ matrix.llvm }}-${{ matrix.artifact-tag }}-${{ matrix.os }}.tar.gz install |
| 90 | +
|
| 91 | + - name: Dump ccache Statistics |
| 92 | + run: ccache -s |
| 93 | + |
| 94 | + - uses: ncipollo/release-action@v1 |
| 95 | + with: |
| 96 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 97 | + tag: optsched-artifacts |
| 98 | + commit: github-workflows |
| 99 | + name: OptSched Artifacts |
| 100 | + body: | |
| 101 | + For pre-built LLVM binaries/libraries/include files, configured for OptSched. |
| 102 | + artifacts: llvm-${{ matrix.llvm }}-${{ matrix.artifact-tag }}-${{ matrix.os }}.tar.gz |
| 103 | + allowUpdates: true |
| 104 | + |
| 105 | + |
| 106 | + build-adapted-llvm: |
| 107 | + needs: update-release-tag |
| 108 | + |
| 109 | + strategy: |
| 110 | + matrix: |
| 111 | + os: [ubuntu-20.04, ubuntu-18.04] |
| 112 | + asserts: [OFF, ON] |
| 113 | + include: |
| 114 | + - asserts: OFF |
| 115 | + artifact: adapted-llvm-7.x-release |
| 116 | + branch: optsched-7.x |
| 117 | + - asserts: ON |
| 118 | + artifact: adapted-llvm-7.x-release-asserts |
| 119 | + branch: optsched-7.x |
| 120 | + - asserts: OFF |
| 121 | + artifact: adapted-llvm-6.x-release |
| 122 | + branch: optsched |
| 123 | + - asserts: ON |
| 124 | + artifact: adapted-llvm-6.x-release-asserts |
| 125 | + branch: optsched |
| 126 | + |
| 127 | + runs-on: ${{ matrix.os }} |
| 128 | + |
| 129 | + steps: |
| 130 | + - uses: actions/checkout@v2 |
| 131 | + with: |
| 132 | + ref: ${{ matrix.branch }} |
| 133 | + |
| 134 | + - name: Install dependencies |
| 135 | + run: | |
| 136 | + sudo apt-get install ninja-build |
| 137 | + sudo apt-get install ccache |
| 138 | +
|
| 139 | + - name: Set up ccache |
| 140 | + uses: actions/cache@v2 |
| 141 | + with: |
| 142 | + path: .ccache |
| 143 | + key: ccache-${{ matrix.asserts }}-adapted |
| 144 | + |
| 145 | + - name: Configure |
| 146 | + run: | |
| 147 | + mkdir build && cd build |
| 148 | + cmake ../llvm -GNinja \ |
| 149 | + -DCMAKE_BUILD_TYPE=Release \ |
| 150 | + -DCMAKE_PARALLEL_LINK_JOBS=1 \ |
| 151 | + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
| 152 | + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ |
| 153 | + -DCMAKE_INSTALL_PREFIX=$(cd ..; pwd)/install \ |
| 154 | + -DLLVM_ENABLE_PROJECTS='clang' \ |
| 155 | + '-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU' \ |
| 156 | + -DLLVM_INCLUDE_TESTS=ON \ |
| 157 | + -DLLVM_OPTIMIZED_TABLEGEN=ON \ |
| 158 | + -DLLVM_ENABLE_ASSERTIONS=${{ matrix.asserts }} |
| 159 | +
|
| 160 | + - name: Build |
| 161 | + working-directory: build |
| 162 | + run: | |
| 163 | + ninja || true |
| 164 | + ninja || true |
| 165 | + ninja || true |
| 166 | + ninja || true |
| 167 | + ninja |
| 168 | +
|
| 169 | + - name: Install |
| 170 | + working-directory: build |
| 171 | + run: | |
| 172 | + ninja install |
| 173 | +
|
| 174 | + - name: Copy Private Headers |
| 175 | + run: | |
| 176 | + mkdir -p install/include/private |
| 177 | + cp llvm/lib/Target/AMDGPU/*.h install/include/private |
| 178 | + cp build/lib/Target/AMDGPU/*.inc install/include/private |
| 179 | +
|
| 180 | + - name: Build artifact |
| 181 | + run: | |
| 182 | + tar -czf ${{ matrix.artifact }}-${{ matrix.os }}.tar.gz install |
| 183 | +
|
| 184 | + - name: Dump ccache Statistics |
| 185 | + run: ccache -s |
| 186 | + |
| 187 | + - uses: ncipollo/release-action@v1 |
| 188 | + with: |
| 189 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 190 | + tag: optsched-artifacts |
| 191 | + commit: github-workflows |
| 192 | + name: OptSched Artifacts |
| 193 | + body: | |
| 194 | + For pre-built LLVM binaries/libraries/include files, configured for OptSched. |
| 195 | + artifacts: ${{ matrix.artifact }}-${{ matrix.os }}.tar.gz |
| 196 | + allowUpdates: true |
0 commit comments