# SPDX-License-Identifier: GPL-2.0-only # SPDX-FileCopyrightText: 2025 KolibriOS team name: 'Build system' on: pull_request: branches: - 'main' jobs: codestyle: name: "Check kernel codestyle" runs-on: kolibri-toolchain steps: - name: Checkout uses: actions/checkout@v4 - name: Check codestyle run: | find kernel/trunk -iname '*.asm' -or -iname '*.inc' -exec bash -c "echo {}; cat {} | perl .gitea/workflows/checker.pl" \; build: name: 'Build' runs-on: kolibri-toolchain steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Get describe id: vars run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITEA_OUTPUT - name: Get toolchain hash id: toolchain-hash run: | a=$(find ${{ gitea.workspace }}/programs/develop/cmm/ -type f -print0 | sort -z | xargs -0 sha1sum) b=$(sha1sum ${{ gitea.workspace }}/programs/develop/ktcc/trunk/bin/kos32-tcc) c=$(find ${{ gitea.workspace }}/programs/develop/objconv/ -type f -print0 | sort -z | xargs -0 sha1sum) d=$(find ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/ -type f -print0 | sort -z | xargs -0 sha1sum) e=$(find ${{ gitea.workspace }}/programs/other/kpack/linux/ -type f -print0 | sort -z | xargs -0 sha1sum) f=$(find ${{ gitea.workspace }}/programs/develop/clink/ -type f -print0 | sort -z | xargs -0 sha1sum) echo hash=$(echo $a $b $c $d $e $f | sha1sum | awk '{print $1}') >> $GITEA_OUTPUT - name: Restore toolchain id: cache-toolchain uses: actions/cache/restore@v4 with: path: /home/autobuild key: kolibri-toolchain-${{ steps.toolchain-hash.outputs.hash }} - name: Build and install C-- if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | cd ${{ gitea.workspace }}/programs/develop/cmm/ make -f Makefile.lin32 chmod +x c-- mv c-- /home/autobuild/tools/win32/bin/c-- cp ${{ gitea.workspace }}/programs/cmm/c--/c--.ini /home/autobuild/tools/win32/bin/c--.ini make -f Makefile.lin32 clean - name: Install TCC if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | cp ${{ gitea.workspace }}/programs/develop/ktcc/trunk/bin/kos32-tcc /home/autobuild/tools/win32/bin/kos32-tcc chmod +x /home/autobuild/tools/win32/bin/kos32-tcc - name: Build and install objconv if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | cd ${{ gitea.workspace }}/programs/develop/objconv/ g++ -o /home/autobuild/tools/win32/bin/objconv -O2 *.cpp chmod +x /home/autobuild/tools/win32/bin/objconv - name: Build and install kerpack and kpack if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | export PATH=/home/autobuild/tools/win32/bin:$PATH cd ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/ make chmod +x kerpack chmod +x kpack mv kerpack /home/autobuild/tools/win32/bin/. mv kpack /home/autobuild/tools/win32/bin/. - name: Build and install clink if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | cd ${{ gitea.workspace }}/programs/develop/clink gcc main.c -o clink chmod a+x clink mv clink /home/autobuild/tools/win32/bin/clink - name: Prepare cache folder run: | rm /home/autobuild mv /root/autobuild /home/autobuild if: steps.cache-toolchain.outputs.cache-hit != 'true' - name: Save toolchain if: steps.cache-toolchain.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: path: /home/autobuild key: kolibri-toolchain-${{ steps.toolchain-hash.outputs.hash }} - name: Configure tup run: | cd ${{ gitea.workspace }} export ROOT=${{ gitea.workspace }} echo "CONFIG_KPACK_CMD= && kpack --nologo %o" | tee en_US.config ru_RU.config es_ES.config echo "CONFIG_KERPACK_CMD= && kerpack %o" | tee -a en_US.config ru_RU.config es_ES.config echo "CONFIG_PESTRIP_CMD= && EXENAME=%o fasm $ROOT/data/common/pestrip.asm %o" | tee -a en_US.config ru_RU.config es_ES.config echo "CONFIG_NO_MSVC=full" | tee -a en_US.config ru_RU.config es_ES.config echo "CONFIG_INSERT_REVISION_ID=1" | tee -a en_US.config ru_RU.config es_ES.config tup -v tup init # Configure en_US echo "CONFIG_LANG=en_US" >> en_US.config echo "CONFIG_BUILD_TYPE=en_US" >> en_US.config tup variant en_US.config # Configure ru_RU echo "CONFIG_LANG=ru_RU" >> ru_RU.config echo "CONFIG_BUILD_TYPE=ru_RU" >> ru_RU.config tup variant ru_RU.config # Configure es_ES echo "CONFIG_LANG=es_ES" >> es_ES.config echo "CONFIG_BUILD_TYPE=es_ES" >> es_ES.config tup variant es_ES.config # -------------------------- Build en_US ------------------------- # - name: (en_US) Build KolibriOS run: | export PATH=/home/autobuild/tools/win32/bin:$PATH source kos32-export-env-vars ${{ gitea.workspace }} tup build-en_US - name: (en_US) Upload floppy image uses: actions/upload-artifact@v3 with: name: kolibrios-en_US-${{ steps.vars.outputs.sha_short }}.img path: build-en_US/data/kolibri.img retention-days: 365 - name: (en_US) Upload CD image uses: actions/upload-artifact@v3 with: name: kolibrios-en_US-${{ steps.vars.outputs.sha_short }}.iso path: build-en_US/data/kolibri.iso retention-days: 30 - name: (en_US) Upload raw image uses: actions/upload-artifact@v3 with: name: kolibrios-en_US-${{ steps.vars.outputs.sha_short }}.raw path: build-en_US/data/kolibri.raw retention-days: 7 # -------------------------- Build ru_RU ------------------------- # - name: (ru_RU) Build KolibriOS run: | export PATH=/home/autobuild/tools/win32/bin:$PATH source kos32-export-env-vars ${{ gitea.workspace }} tup build-ru_RU - name: (ru_RU) Upload floppy image uses: actions/upload-artifact@v3 with: name: kolibrios-ru_RU-${{ steps.vars.outputs.sha_short }}.img path: build-ru_RU/data/kolibri.img retention-days: 365 - name: (ru_RU) Upload CD image uses: actions/upload-artifact@v3 with: name: kolibrios-ru_RU-${{ steps.vars.outputs.sha_short }}.iso path: build-ru_RU/data/kolibri.iso retention-days: 30 - name: (ru_RU) Upload raw image uses: actions/upload-artifact@v3 with: name: kolibrios-ru_RU-${{ steps.vars.outputs.sha_short }}.raw path: build-ru_RU/data/kolibri.raw retention-days: 7 # -------------------------- Build es_ES ------------------------- # - name: (es_ES) Build KolibriOS run: | export PATH=/home/autobuild/tools/win32/bin:$PATH source kos32-export-env-vars ${{ gitea.workspace }} tup build-es_ES - name: (es_ES) Upload floppy image uses: actions/upload-artifact@v3 with: name: kolibrios-es_ES-${{ steps.vars.outputs.sha_short }}.img path: build-es_ES/data/kolibri.img retention-days: 365 - name: (es_ES) Upload CD image uses: actions/upload-artifact@v3 with: name: kolibrios-es_ES-${{ steps.vars.outputs.sha_short }}.iso path: build-es_ES/data/kolibri.iso retention-days: 30 - name: (es_ES) Upload raw image uses: actions/upload-artifact@v3 with: name: kolibrios-es_ES-${{ steps.vars.outputs.sha_short }}.raw path: build-es_ES/data/kolibri.raw retention-days: 7