Skip to content

Commit 948fc55

Browse files
committed
[GITHUB] Add workflow build.yml
1 parent eda41d8 commit 948fc55

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/build.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build-linux:
6+
strategy:
7+
matrix:
8+
compiler: [gcc]
9+
arch: [i386]
10+
config: [Debug, Release]
11+
dllver: ['0x502']
12+
exclude:
13+
- dllver: 0x600
14+
compiler: clang
15+
- dllver: 0x600
16+
config: Release
17+
fail-fast: false
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Get RosBE build specifics
21+
id: get_rosbe_spec
22+
run: |
23+
gcc -march=native -Q --help=target | grep "\-march= " | awk '{print $NF}'
24+
echo march-sha=$(gcc -march=native -Q --help=target | sha1sum | awk '{print $1}') >> $GITHUB_OUTPUT
25+
echo git-sha=$(git ls-remote https://github.com/zefklop/RosBE.git | grep unix_amd64 | awk '{print $1}') >> $GITHUB_OUTPUT
26+
wget https://gist.githubusercontent.com/zefklop/b2d6a0b470c70183e93d5285a03f5899/raw/build_rosbe_ci.sh
27+
- name: Get RosBE
28+
id: get_rosbe
29+
uses: actions/cache@v4
30+
with:
31+
path: RosBE-CI
32+
key: RosBE-CI-${{runner.os}}-${{steps.get_rosbe_spec.outputs.march-sha}}-${{steps.get_rosbe_spec.outputs.git-sha}}-${{hashfiles('./build_rosbe_ci.sh')}}
33+
- name: Compile RosBE
34+
if: ${{ steps.get_rosbe.outputs.cache-hit != 'true' }}
35+
run: |
36+
chmod +x build_rosbe_ci.sh
37+
./build_rosbe_ci.sh ${{github.workspace}}/RosBE-CI
38+
- name: Install ccache
39+
run: sudo apt install ccache
40+
- name: Install LLVM
41+
if: ${{ matrix.compiler == 'clang' }}
42+
run: |
43+
export LLVM_VERSION=13
44+
wget https://apt.llvm.org/llvm.sh
45+
chmod +x llvm.sh
46+
sudo ./llvm.sh $LLVM_VERSION
47+
echo "D_CLANG_VERSION=-DCLANG_VERSION=$LLVM_VERSION" >> $GITHUB_ENV
48+
- name: Source checkout
49+
uses: actions/checkout@v4
50+
with:
51+
path: src
52+
- name: Set up cache for ccache
53+
uses: actions/cache@v4
54+
with:
55+
path: ccache
56+
key: ccache-${{matrix.compiler}}-${{matrix.arch}}-${{matrix.config}}-${{matrix.dllver}}-${{github.sha}}
57+
restore-keys: |
58+
ccache-${{matrix.compiler}}-${{matrix.arch}}-${{matrix.config}}-${{matrix.dllver}}-
59+
- name: Set ccache settings
60+
run: |
61+
echo "CCACHE_BASEDIR=${{github.workspace}}" >> $GITHUB_ENV
62+
echo "CCACHE_DIR=${{github.workspace}}/ccache" >> $GITHUB_ENV
63+
echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
64+
echo "CCACHE_SLOPPINESS=time_macros" >> $GITHUB_ENV
65+
- name: Ease ccache compiler check (GCC)
66+
if: ${{ matrix.compiler == 'gcc' }}
67+
run: echo "CCACHE_COMPILERCHECK=string:${{steps.get_rosbe_spec.outputs.git-sha}}-${{hashfiles('./build_rosbe_ci.sh')}}" >> $GITHUB_ENV
68+
- name: Configure
69+
run: echo 'cmake -S ${{github.workspace}}/src -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-${{matrix.compiler}}.cmake -DARCH:STRING=${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.config}} -DDLL_EXPORT_VERSION=${{matrix.dllver}} -DENABLE_CCACHE=1 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 ${{env.D_CLANG_VERSION}}' | ${{github.workspace}}/RosBE-CI/RosBE.sh . 0 ${{matrix.arch}}
70+
- name: Build
71+
run: echo 'cmake --build ${{github.workspace}}/build -- -k0' | ${{github.workspace}}/RosBE-CI/RosBE.sh . 0 ${{matrix.arch}}
72+
- name: Generate ISOs
73+
run: echo 'cmake --build ${{github.workspace}}/build --target bootcd --target livecd' | ${{github.workspace}}/RosBE-CI/RosBE.sh . 0 ${{matrix.arch}}
74+
- name: Print ccache statistics
75+
run: ccache -s
76+
- name: Upload ISOs
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: reactos-${{matrix.compiler}}-${{matrix.arch}}-${{matrix.config}}-${{matrix.dllver}}-${{github.sha}}
80+
path: |
81+
build/bootcd.iso
82+
build/livecd.iso

0 commit comments

Comments
 (0)