|
1 |
| -name: Build and Test |
2 |
| - |
3 |
| -on: |
4 |
| - workflow_dispatch: |
5 |
| - pull_request: |
6 |
| - push: |
7 |
| - branches: |
8 |
| - - "master" |
9 |
| - |
10 |
| -permissions: |
11 |
| - contents: read |
12 |
| - |
13 |
| -# This allows a subsequently queued workflow run to interrupt previous runs |
14 |
| -concurrency: |
15 |
| - group: '${{ github.workflow }} @ ${{ github.ref_protected && github.run_id || github.event.pull_request.number || github.ref }}' |
16 |
| - cancel-in-progress: true |
17 |
| - |
18 |
| -jobs: |
19 |
| - build: |
20 |
| - strategy: |
21 |
| - matrix: |
22 |
| - include: |
23 |
| - - os: ubuntu-latest |
24 |
| - - os: macos-latest |
25 |
| - runs-on: ${{ matrix.os }} |
26 |
| - steps: |
27 |
| - - name: Checkout |
28 |
| - uses: actions/checkout@v3 |
29 |
| - |
30 |
| - - name: Setup LLVM (Linux) |
31 |
| - if: ${{ runner.os == 'Linux' }} |
32 |
| - run: | |
33 |
| - wget https://apt.llvm.org/llvm.sh |
34 |
| - chmod +x llvm.sh |
35 |
| - sudo ./llvm.sh 19 all |
36 |
| - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 160 |
37 |
| - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 160 |
38 |
| - sudo update-alternatives --install /usr/bin/lli lli /usr/bin/lli-19 160 |
39 |
| - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 160 |
40 |
| -
|
41 |
| - - name: Setup LLVM and GCC (MacOS) |
42 |
| - if: ${{ runner.os == 'macOS' }} |
43 |
| - run: | |
44 |
| - brew install llvm@19 |
45 |
| - echo "$(brew --prefix llvm@19)/bin" >> $GITHUB_PATH |
46 |
| - echo "CC=$(brew --prefix llvm@19)/bin/clang" >> $GITHUB_ENV |
47 |
| - echo "CXX=$(brew --prefix llvm@19)/bin/clang++" >> $GITHUB_ENV |
48 |
| - cd /usr/local/bin |
49 |
| - ln -s gcc-11 gcc |
50 |
| -
|
51 |
| - - name: Update Python |
52 |
| - uses: actions/setup-python@v4 |
53 |
| - with: |
54 |
| - python-version: '3.x' |
55 |
| - |
56 |
| - - name: Install PyTest |
57 |
| - run: | |
58 |
| - python -m pip install --upgrade pip |
59 |
| - pip install pytest pytest-xdist |
60 |
| -
|
61 |
| - - name: Check formatting |
62 |
| - if: ${{ runner.os == 'Linux' }} |
63 |
| - run: find . -iname '*.h' -o -iname '*.cpp' | xargs clang-format -Werror --dry-run --style=LLVM --verbose |
64 |
| - |
65 |
| - - name: Build |
66 |
| - run: | |
67 |
| - mkdir build |
68 |
| - cmake -S . -B build -DLLVM_INCLUDE_TESTS=On -DLLVM_DIR=/usr/lib/llvm-19/cmake |
69 |
| - cmake --build build |
70 |
| -
|
71 |
| - - name: Test |
72 |
| - run: | |
73 |
| - gcc --version |
74 |
| - pytest -n 16 |
75 |
| -
|
76 |
| - # The llvm-dev package doesn't exist for Windows, so we need to build LLVM ourselves. |
77 |
| - build-windows: |
78 |
| - runs-on: windows-latest |
79 |
| - env: |
80 |
| - SCCACHE_GHA_ENABLED: "true" |
81 |
| - steps: |
82 |
| - - name: Checkout LLVM |
83 |
| - id: checkout-llvm |
84 |
| - uses: actions/checkout@master |
85 |
| - with: |
86 |
| - repository: llvm/llvm-project |
87 |
| - ref: llvmorg-19.1.1 |
88 |
| - |
89 |
| - - name: Checkout |
90 |
| - uses: actions/checkout@v3 |
91 |
| - with: |
92 |
| - path: ${{ github.workspace }}/llvm/projects/llvm-cbe |
93 |
| - |
94 |
| - - name: Update Python |
95 |
| - uses: actions/setup-python@v4 |
96 |
| - with: |
97 |
| - python-version: '3.x' |
98 |
| - |
99 |
| - - name: Install PyTest |
100 |
| - run: | |
101 |
| - python -m pip install --upgrade pip |
102 |
| - pip install pytest pytest-xdist |
103 |
| -
|
104 |
| - - name: Initialize LLVM build cache |
105 |
| - uses: mozilla-actions/sccache-action@v0.0.3 |
106 |
| - |
107 |
| - - name: Build |
108 |
| - shell: pwsh |
109 |
| - run: | |
110 |
| - $vsWhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' |
111 |
| - $visualStudioInstallationPath = & $vsWhere -latest -property installationPath |
112 |
| - Import-Module (Join-Path $visualStudioInstallationPath 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll') |
113 |
| - Enter-VsDevShell -VsInstallPath $visualStudioInstallationPath -DevCmdArguments '-arch=x64 -host_arch=x64' |
114 |
| - cd ${{ github.workspace }} |
115 |
| - if (!(Test-Path '${{ github.workspace }}\build\')) { mkdir '${{ github.workspace }}\build' } |
116 |
| - cmake -S llvm -B build -G Ninja -DLLVM_INCLUDE_TESTS=On -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache |
117 |
| - cmake --build build |
118 |
| -
|
119 |
| - - name: Test |
120 |
| - shell: pwsh |
121 |
| - run: | |
122 |
| - $vsWhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' |
123 |
| - $visualStudioInstallationPath = & $vsWhere -latest -property installationPath |
124 |
| - Import-Module (Join-Path $visualStudioInstallationPath 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll') |
125 |
| - Enter-VsDevShell -VsInstallPath $visualStudioInstallationPath -DevCmdArguments '-arch=x64 -host_arch=x64' |
126 |
| - cd (Join-Path '${{ github.workspace }}' 'llvm\projects\llvm-cbe') |
127 |
| - $env:PATH=$env:Path + ";${{ github.workspace }}\build\bin" |
128 |
| - $env:LLVMToolDir="${{ github.workspace }}\build\bin" |
129 |
| - pytest -n 16 |
| 1 | +name: Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - "master" |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +# This allows a subsequently queued workflow run to interrupt previous runs |
| 14 | +concurrency: |
| 15 | + group: '${{ github.workflow }} @ ${{ github.ref_protected && github.run_id || github.event.pull_request.number || github.ref }}' |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + include: |
| 23 | + - os: ubuntu-latest |
| 24 | + - os: macos-latest |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v3 |
| 29 | + |
| 30 | + - name: Setup LLVM (Linux) |
| 31 | + if: ${{ runner.os == 'Linux' }} |
| 32 | + run: | |
| 33 | + wget https://apt.llvm.org/llvm.sh |
| 34 | + chmod +x llvm.sh |
| 35 | + sudo ./llvm.sh 19 all |
| 36 | + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 160 |
| 37 | + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 160 |
| 38 | + sudo update-alternatives --install /usr/bin/lli lli /usr/bin/lli-19 160 |
| 39 | + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 160 |
| 40 | +
|
| 41 | + - name: Setup LLVM and GCC (MacOS) |
| 42 | + if: ${{ runner.os == 'macOS' }} |
| 43 | + run: | |
| 44 | + brew install llvm@19 gcc@14 |
| 45 | + echo "$(brew --prefix llvm@19)/bin" >> $GITHUB_PATH |
| 46 | + echo "CC=$(brew --prefix llvm@19)/bin/clang" >> $GITHUB_ENV |
| 47 | + echo "CXX=$(brew --prefix llvm@19)/bin/clang++" >> $GITHUB_ENV |
| 48 | + cd /usr/local/bin |
| 49 | + ln -s `which gcc-14` gcc |
| 50 | +
|
| 51 | + - name: Update Python |
| 52 | + uses: actions/setup-python@v4 |
| 53 | + with: |
| 54 | + python-version: '3.x' |
| 55 | + |
| 56 | + - name: Install PyTest |
| 57 | + run: | |
| 58 | + python -m pip install --upgrade pip |
| 59 | + pip install pytest pytest-xdist |
| 60 | +
|
| 61 | + - name: Check formatting |
| 62 | + if: ${{ runner.os == 'Linux' }} |
| 63 | + run: find . -iname '*.h' -o -iname '*.cpp' | xargs clang-format -Werror --dry-run --style=LLVM --verbose |
| 64 | + |
| 65 | + - name: Build |
| 66 | + run: | |
| 67 | + mkdir build |
| 68 | + cmake -S . -B build -DLLVM_INCLUDE_TESTS=On -DLLVM_DIR=/usr/lib/llvm-19/cmake |
| 69 | + cmake --build build |
| 70 | +
|
| 71 | + - name: Test |
| 72 | + run: | |
| 73 | + gcc --version |
| 74 | + pytest -n 16 |
| 75 | +
|
| 76 | + # The llvm-dev package doesn't exist for Windows, so we need to build LLVM ourselves. |
| 77 | + build-windows: |
| 78 | + runs-on: windows-latest |
| 79 | + env: |
| 80 | + SCCACHE_GHA_ENABLED: "true" |
| 81 | + steps: |
| 82 | + - name: Checkout LLVM |
| 83 | + id: checkout-llvm |
| 84 | + uses: actions/checkout@master |
| 85 | + with: |
| 86 | + repository: llvm/llvm-project |
| 87 | + ref: llvmorg-19.1.1 |
| 88 | + |
| 89 | + - name: Checkout |
| 90 | + uses: actions/checkout@v3 |
| 91 | + with: |
| 92 | + path: ${{ github.workspace }}/llvm/projects/llvm-cbe |
| 93 | + |
| 94 | + - name: Update Python |
| 95 | + uses: actions/setup-python@v4 |
| 96 | + with: |
| 97 | + python-version: '3.x' |
| 98 | + |
| 99 | + - name: Install PyTest |
| 100 | + run: | |
| 101 | + python -m pip install --upgrade pip |
| 102 | + pip install pytest pytest-xdist |
| 103 | +
|
| 104 | + - name: Initialize LLVM build cache |
| 105 | + uses: mozilla-actions/sccache-action@v0.0.3 |
| 106 | + |
| 107 | + - name: Build |
| 108 | + shell: pwsh |
| 109 | + run: | |
| 110 | + $vsWhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' |
| 111 | + $visualStudioInstallationPath = & $vsWhere -latest -property installationPath |
| 112 | + Import-Module (Join-Path $visualStudioInstallationPath 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll') |
| 113 | + Enter-VsDevShell -VsInstallPath $visualStudioInstallationPath -DevCmdArguments '-arch=x64 -host_arch=x64' |
| 114 | + cd ${{ github.workspace }} |
| 115 | + if (!(Test-Path '${{ github.workspace }}\build\')) { mkdir '${{ github.workspace }}\build' } |
| 116 | + cmake -S llvm -B build -G Ninja -DLLVM_INCLUDE_TESTS=On -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache |
| 117 | + cmake --build build |
| 118 | +
|
| 119 | + - name: Test |
| 120 | + shell: pwsh |
| 121 | + run: | |
| 122 | + $vsWhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' |
| 123 | + $visualStudioInstallationPath = & $vsWhere -latest -property installationPath |
| 124 | + Import-Module (Join-Path $visualStudioInstallationPath 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll') |
| 125 | + Enter-VsDevShell -VsInstallPath $visualStudioInstallationPath -DevCmdArguments '-arch=x64 -host_arch=x64' |
| 126 | + cd (Join-Path '${{ github.workspace }}' 'llvm\projects\llvm-cbe') |
| 127 | + $env:PATH=$env:Path + ";${{ github.workspace }}\build\bin" |
| 128 | + $env:LLVMToolDir="${{ github.workspace }}\build\bin" |
| 129 | + pytest -n 16 |
0 commit comments