xref: /reactos/.github/workflows/build.yml (revision 7b1049c8)
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: Install other packages
68        run: |
69          sudo apt install ccache
70          sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
71          sudo apt install clang-11
72      - uses: actions/checkout@v2
73        with:
74          path: src
75      - name: Set up cache for ccache
76        uses: actions/cache@v2
77        with:
78          path: ccache
79          key: ccache-clang-i386-${{github.sha}}
80          restore-keys: |
81            ccache-clang-i386-
82      - name: Set ccache settings
83        run: |
84          echo "CCACHE_BASEDIR=${{github.workspace}}" >> $GITHUB_ENV
85          echo "CCACHE_DIR=${{github.workspace}}/ccache" >> $GITHUB_ENV
86          echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
87          echo "CCACHE_SLOPPINESS=time_macros" >> $GITHUB_ENV
88      - name: Configure
89        run: |
90          mkdir build
91          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=11' > commands
92          ${{github.workspace}}/rosbe/RosBE.sh < commands
93      - name: Build
94        run: |
95          echo 'cd ${{github.workspace}}/build && cmake --build .' > commands
96          ${{github.workspace}}/rosbe/RosBE.sh < commands
97      - name: Print ccache statistics
98        run: ccache -s
99
100  build-clang-cl-i386:
101    name: Clang-CL (i386)
102    runs-on: windows-latest
103    steps:
104    - name: Install packages
105      run: |
106        choco install ninja -y
107        choco install --x86 -y llvm
108    - name: Install Flex and Bison
109      run: |
110        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
111        7z x flexbison.7z -O${{github.workspace}}\bin
112        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
113        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
114        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
115    - name: Add CL to PATH
116      uses: ilammy/msvc-dev-cmd@v1
117      with:
118        arch: amd64_x86
119    - uses: actions/checkout@v2
120      with:
121        path: src
122    - name: Configure
123      run: |
124        mkdir build
125        cd build
126        $env:PATH = "${env:PROGRAMFILES(X86)}\llvm\bin;$env:PATH"
127        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
128    - name: Build
129      working-directory: ${{github.workspace}}\build
130      run: cmake --build .
131    - name: Generate ISOs
132      working-directory: ${{github.workspace}}\build
133      run: |
134        cmake --build . --target bootcd
135        cmake --build . --target livecd
136
137  build-msvc-i386:
138    name: MSVC (i386)
139    runs-on: windows-latest
140    steps:
141    - name: Install packages
142      run: choco install ninja -y
143    - name: Install Flex and Bison
144      run: |
145        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
146        7z x flexbison.7z -O${{github.workspace}}\bin
147        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
148        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
149        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
150    - name: Add CL to PATH
151      uses: ilammy/msvc-dev-cmd@v1
152      with:
153        arch: amd64_x86
154    - uses: actions/checkout@v2
155      with:
156        path: src
157    - name: Configure
158      run: |
159        mkdir build
160        cd build
161        cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=i386 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{github.workspace}}\src
162    - name: Build
163      working-directory: ${{github.workspace}}\build
164      run: cmake --build .
165    - name: Generate ISOs
166      working-directory: ${{github.workspace}}\build
167      run: |
168        cmake --build . --target bootcd
169        cmake --build . --target livecd
170    - name: Upload bootcd
171      uses: actions/upload-artifact@v2
172      with:
173        name: reactos-msvc-i386-${{github.sha}}
174        path: build/bootcd.iso
175    - name: Upload livecd
176      uses: actions/upload-artifact@v2
177      with:
178        name: reactos-msvc-i386-${{github.sha}}
179        path: build/livecd.iso
180
181  build-msvc-amd64:
182    name: MSVC (amd64)
183    runs-on: windows-latest
184    steps:
185    - name: Install packages
186      run: choco install ninja -y
187    - name: Install Flex and Bison
188      run: |
189        curl -O https://svn.reactos.org/storage/vperevertkin/flexbison.7z
190        7z x flexbison.7z -O${{github.workspace}}\bin
191        echo "${{github.workspace}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
192        echo "BISON_PKGDATADIR=${{github.workspace}}\bin\share\bison" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
193        echo "M4=${{github.workspace}}\bin\m4.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
194    - name: Add CL to PATH
195      uses: ilammy/msvc-dev-cmd@v1
196      with:
197        arch: amd64
198    - uses: actions/checkout@v2
199      with:
200        path: src
201    - name: Configure
202      run: |
203        mkdir build
204        cd build
205        cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=amd64 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{github.workspace}}\src
206    - name: Build
207      working-directory: ${{github.workspace}}\build
208      run: |
209        cmake --build .
210    - name: Generate ISOs
211      working-directory: ${{github.workspace}}\build
212      run: |
213        cmake --build . --target bootcd
214        cmake --build . --target livecd
215    - name: Upload bootcd
216      uses: actions/upload-artifact@v2
217      with:
218        name: reactos-msvc-amd64-${{github.sha}}
219        path: build/bootcd.iso
220    - name: Upload livecd
221      uses: actions/upload-artifact@v2
222      with:
223        name: reactos-msvc-amd64-${{github.sha}}
224        path: build/livecd.iso
225