xref: /reactos/.github/workflows/build.yml (revision a1fc312a)
1name: Build
2on: [push, pull_request]
3
4jobs:
5  build-gcc-i386:
6    name: GCC (i386)
7    runs-on: ubuntu-latest
8    steps:
9    - name: Install RosBE
10      run: |
11        wget https://svn.reactos.org/storage/vperevertkin/rosbe-ci.tar.zst
12        mkdir ${{github.workspace}}/rosbe
13        tar -I zstd -xvf rosbe-ci.tar.zst --directory ${{github.workspace}}/rosbe
14    - name: Install other packages
15      run: sudo apt install ccache
16    - uses: actions/checkout@v2
17      with:
18        path: src
19    - name: Set up cache for ccache
20      uses: actions/cache@v2
21      with:
22        path: ccache
23        key: ccache-gcc-i386-${{github.sha}}
24        restore-keys: |
25          ccache-gcc-i386-
26    - name: Set ccache settings
27      run: |
28        echo "CCACHE_BASEDIR=${{github.workspace}}" >> $GITHUB_ENV
29        echo "CCACHE_DIR=${{github.workspace}}/ccache" >> $GITHUB_ENV
30        echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
31        echo "CCACHE_SLOPPINESS=time_macros" >> $GITHUB_ENV
32    - name: Configure
33      run: |
34        mkdir build
35        echo 'cd ${{github.workspace}}/build && ${{github.workspace}}/src/configure.sh -DENABLE_CCACHE=1 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1' > commands
36        ${{github.workspace}}/rosbe/RosBE.sh < commands
37    - name: Build
38      run: |
39        echo 'cd ${{github.workspace}}/build && cmake --build .' > commands
40        ${{github.workspace}}/rosbe/RosBE.sh < commands
41    - name: Generate ISOs
42      run: |
43        echo 'cd ${{github.workspace}}/build && cmake --build . --target bootcd && cmake --build . --target livecd' > commands
44        ${{github.workspace}}/rosbe/RosBE.sh < 'commands'
45    - name: Print ccache statistics
46      run: ccache -s
47    - name: Upload bootcd
48      uses: actions/upload-artifact@v2
49      with:
50        name: reactos-gcc-i386-${{github.sha}}
51        path: build/bootcd.iso
52    - name: Upload livecd
53      uses: actions/upload-artifact@v2
54      with:
55        name: reactos-gcc-i386-${{github.sha}}
56        path: build/livecd.iso
57
58  build-clang-i386:
59    name: Clang (i386)
60    runs-on: ubuntu-latest
61    steps:
62    - name: Install RosBE
63      run: |
64        wget https://svn.reactos.org/storage/vperevertkin/rosbe-ci.tar.zst
65        mkdir ${{github.workspace}}/rosbe
66        tar -I zstd -xvf rosbe-ci.tar.zst --directory ${{github.workspace}}/rosbe
67    - name: Set LLVM version
68      run: |
69        echo "LLVM_VERSION=12" >> $GITHUB_ENV
70    - name: Install LLVM
71      run: |
72        wget https://apt.llvm.org/llvm.sh
73        chmod +x llvm.sh
74        sudo ./llvm.sh $LLVM_VERSION
75    - name: Install other packages
76      run: |
77        sudo apt install ccache
78    - uses: actions/checkout@v2
79      with:
80        path: src
81    - name: Set up cache for ccache
82      uses: actions/cache@v2
83      with:
84        path: ccache
85        key: ccache-clang-i386-${{github.sha}}
86        restore-keys: |
87          ccache-clang-i386-
88    - name: Set ccache settings
89      run: |
90        echo "CCACHE_BASEDIR=${{github.workspace}}" >> $GITHUB_ENV
91        echo "CCACHE_DIR=${{github.workspace}}/ccache" >> $GITHUB_ENV
92        echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
93        echo "CCACHE_SLOPPINESS=time_macros" >> $GITHUB_ENV
94    - name: Configure
95      run: |
96        mkdir build
97        echo 'cd ${{github.workspace}}/build && cmake ${{github.workspace}}/src -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-clang.cmake -DARCH:STRING=i386 -DENABLE_CCACHE=1 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 -DCLANG_VERSION=${{env.LLVM_VERSION}}' > commands
98        ${{github.workspace}}/rosbe/RosBE.sh < commands
99    - name: Build
100      run: |
101        echo 'cd ${{github.workspace}}/build && cmake --build .' > commands
102        ${{github.workspace}}/rosbe/RosBE.sh < commands
103    - name: Print ccache statistics
104      run: ccache -s
105
106  build-clang-cl-i386:
107    name: Clang-CL (i386)
108    runs-on: windows-latest
109    steps:
110    - name: Install packages
111      run: |
112        choco install ninja -y
113        choco install --x86 -y llvm
114    - name: Install Flex and Bison
115      run: |
116        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
117        7z x flexbison.7z -O${{github.workspace}}\bin
118        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
119        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
120        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
121    - name: Add CL to PATH
122      uses: ilammy/msvc-dev-cmd@v1
123      with:
124        arch: amd64_x86
125    - uses: actions/checkout@v2
126      with:
127        path: src
128    - name: Configure
129      run: |
130        mkdir build
131        cd build
132        $env:PATH = "${env:PROGRAMFILES(X86)}\llvm\bin;$env:PATH"
133        cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=i386 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 -DUSE_CLANG_CL:BOOL=1 ${{github.workspace}}\src
134    - name: Build
135      working-directory: ${{github.workspace}}\build
136      run: cmake --build .
137    - name: Generate ISOs
138      working-directory: ${{github.workspace}}\build
139      run: |
140        cmake --build . --target bootcd
141        cmake --build . --target livecd
142
143  build-msvc-i386:
144    name: MSVC (i386)
145    runs-on: windows-latest
146    steps:
147    - name: Install packages
148      run: choco install ninja -y
149    - name: Install Flex and Bison
150      run: |
151        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
152        7z x flexbison.7z -O${{github.workspace}}\bin
153        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
154        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
155        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
156    - name: Add CL to PATH
157      uses: ilammy/msvc-dev-cmd@v1
158      with:
159        arch: amd64_x86
160    - uses: actions/checkout@v2
161      with:
162        path: src
163    - name: Configure
164      run: |
165        mkdir build
166        cd build
167        cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=i386 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{github.workspace}}\src
168    - name: Build
169      working-directory: ${{github.workspace}}\build
170      run: cmake --build .
171    - name: Generate ISOs
172      working-directory: ${{github.workspace}}\build
173      run: |
174        cmake --build . --target bootcd
175        cmake --build . --target livecd
176    - name: Upload bootcd
177      uses: actions/upload-artifact@v2
178      with:
179        name: reactos-msvc-i386-${{github.sha}}
180        path: build/bootcd.iso
181    - name: Upload livecd
182      uses: actions/upload-artifact@v2
183      with:
184        name: reactos-msvc-i386-${{github.sha}}
185        path: build/livecd.iso
186
187  build-msvc-amd64:
188    name: MSVC (amd64)
189    runs-on: windows-latest
190    steps:
191    - name: Install packages
192      run: choco install ninja -y
193    - name: Install Flex and Bison
194      run: |
195        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
196        7z x flexbison.7z -O${{github.workspace}}\bin
197        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
198        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
199        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
200    - name: Add CL to PATH
201      uses: ilammy/msvc-dev-cmd@v1
202      with:
203        arch: amd64
204    - uses: actions/checkout@v2
205      with:
206        path: src
207    - name: Configure
208      run: |
209        mkdir build
210        cd build
211        cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=amd64 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{github.workspace}}\src
212    - name: Build
213      working-directory: ${{github.workspace}}\build
214      run: |
215        cmake --build .
216    - name: Generate ISOs
217      working-directory: ${{github.workspace}}\build
218      run: |
219        cmake --build . --target bootcd
220        cmake --build . --target livecd
221    - name: Upload bootcd
222      uses: actions/upload-artifact@v2
223      with:
224        name: reactos-msvc-amd64-${{github.sha}}
225        path: build/bootcd.iso
226    - name: Upload livecd
227      uses: actions/upload-artifact@v2
228      with:
229        name: reactos-msvc-amd64-${{github.sha}}
230        path: build/livecd.iso
231
232  build-msbuild-i386:
233    name: MSBuild (i386)
234    runs-on: windows-latest
235    steps:
236    - name: Install Flex and Bison
237      run: |
238        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
239        7z x flexbison.7z -O${{github.workspace}}\bin
240        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
241        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
242        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
243    - name: Add CL to PATH
244      uses: ilammy/msvc-dev-cmd@v1
245      with:
246        arch: amd64_x86
247    - uses: actions/checkout@v2
248      with:
249        path: src
250    - name: Configure
251      run: |
252        mkdir build
253        cd build
254        cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=i386 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{github.workspace}}\src
255    - name: Build
256      run: cmake --build ${{github.workspace}}\build --target bootcd --target livecd
257