|
| 1 | +name: snmalloc CI for Morello |
| 2 | + |
| 3 | +# Controls when the workflow will run |
| 4 | +on: |
| 5 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 6 | + push: |
| 7 | + branches: [ main ] |
| 8 | + pull_request: |
| 9 | + branches: [ main ] |
| 10 | + |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + # UNIX-like, but with some needed TLC for the moment, so not folded in to the main unixlike CI. |
| 16 | + # Morello can't easily self-host since it mixes purecap and hybrid build tools. |
| 17 | + # We point cmake at the LLVM Clang frontend explicitly lest it pick up the more magic wrappers. |
| 18 | + morello: |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + # Build each combination of OS and release/debug variants |
| 22 | + os: [ "morello" ] |
| 23 | + build-type: [ Release, Debug ] |
| 24 | + caps: [ Hybrid, Purecap ] |
| 25 | + include: |
| 26 | + - os: "morello" |
| 27 | + caps: Hybrid |
| 28 | + dependencies: | |
| 29 | + pkg64 install -y llvm-localbase cmake ninja |
| 30 | + cmake-flags: > |
| 31 | + -DCMAKE_CXX_COMPILER=/usr/local64/bin/clang++ |
| 32 | + -DCMAKE_C_COMPILER=/usr/local64/bin/clang |
| 33 | + -DCMAKE_CXX_FLAGS='-march=morello -Xclang -morello-vararg=new' |
| 34 | + -DCMAKE_C_FLAGS='-march=morello -Xclang -morello-vararg=new' |
| 35 | + - os: "morello" |
| 36 | + caps: Purecap |
| 37 | + dependencies: | |
| 38 | + pkg64 install -y llvm-localbase cmake ninja |
| 39 | + cmake-flags: > |
| 40 | + -DCMAKE_CXX_COMPILER=/usr/local64/bin/clang++ |
| 41 | + -DCMAKE_C_COMPILER=/usr/local64/bin/clang |
| 42 | + -DCMAKE_CXX_FLAGS='-march=morello -mabi=purecap -Xclang -morello-vararg=new' |
| 43 | + -DCMAKE_C_FLAGS='-march=morello -mabi=purecap -Xclang -morello-vararg=new' |
| 44 | + -DSNMALLOC_LINK_ICF=OFF |
| 45 | + # SNMALLOC_LINK_ICF=OFF until the fix for |
| 46 | + # https://git.morello-project.org/morello/llvm-project/-/issues/51 , namely |
| 47 | + # https://git.morello-project.org/morello/llvm-project/-/commit/f41cb9104e0793de87d98b38acb274b2e3266091 |
| 48 | + # lands in a package or a release. That's probably the Fall 2022 release. |
| 49 | + # Don't abort runners if a single one fails |
| 50 | + fail-fast: false |
| 51 | + # Morello needs special handling to get picked up by our self-hosted runners |
| 52 | + # When/if we do integrate this back into the unixlike matrix above, we could |
| 53 | + # say something like:: |
| 54 | + # runs-on: >- |
| 55 | + # ${{ (matrix.os == 'morello' && fromJSON('["self-hosted", "msr-morello", "2022.05-benchmark"]')) |
| 56 | + # || matrix.os }} |
| 57 | + # to dispatch dynamically. |
| 58 | + runs-on: ["self-hosted", "msr-morello", "2022.05-benchmark"] |
| 59 | + name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.caps }} |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v2 |
| 62 | + - name: Install build dependencies |
| 63 | + run: ${{ matrix.dependencies }} |
| 64 | + - name: Configure CMake |
| 65 | + run: > |
| 66 | + cmake |
| 67 | + -B ${{github.workspace}}/build |
| 68 | + -DCMAKE_BUILD_TYPE=${{matrix.build-type}} |
| 69 | + -G Ninja ${{ matrix.cmake-flags }} |
| 70 | + ${{ matrix.extra-cmake-flags }} |
| 71 | + # Build with a nice ninja status line |
| 72 | + - name: Build |
| 73 | + # https://github.com/ChristopherHX/github-act-runner seemingly ignores working-directory, |
| 74 | + # but everyone agrees that we start in ${{github.workspace}} by default, so just cd into |
| 75 | + # the build directory ourselves. See |
| 76 | + # https://docs.github.com/en/actions/learn-github-actions/contexts#github-context |
| 77 | + # https://github.com/ChristopherHX/github-act-runner/issues/61 |
| 78 | + # working-directory: ${{github.workspace}}/build |
| 79 | + run: | |
| 80 | + cd build |
| 81 | + NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja |
| 82 | + - name: Test file size of binaries is sane |
| 83 | + # working-directory: ${{github.workspace}}/build |
| 84 | + run: | |
| 85 | + cd build |
| 86 | + ls -l func-first_operation-fast ; [ $(ls -l func-first_operation-fast | awk '{ print $5}') -lt 10000000 ] |
| 87 | + # If the tests are enabled for this job, run them |
| 88 | + - name: Test |
| 89 | + if: ${{ matrix.build-only != 'yes' }} |
| 90 | + # working-directory: ${{github.workspace}}/build |
| 91 | + run: | |
| 92 | + cd build |
| 93 | + ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400 |
0 commit comments