| 1 | name: Build Vinix |
| 2 | |
| 3 | on: |
| 4 | workflow_call: |
| 5 | pull_request: |
| 6 | paths-ignore: |
| 7 | - '**.md' |
| 8 | - '**.yml' |
| 9 | - '!**/vinix_ci.yml' |
| 10 | - 'cmd/tools/vrepl.v' |
| 11 | push: |
| 12 | branches: |
| 13 | - master |
| 14 | paths-ignore: |
| 15 | - '**.md' |
| 16 | - '**.yml' |
| 17 | - '!**/vinix_ci.yml' |
| 18 | - 'cmd/tools/vrepl.v' |
| 19 | |
| 20 | concurrency: |
| 21 | group: vinix-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} |
| 22 | cancel-in-progress: true |
| 23 | |
| 24 | jobs: |
| 25 | vinix-build: |
| 26 | runs-on: ubuntu-24.04 |
| 27 | timeout-minutes: 20 |
| 28 | steps: |
| 29 | - uses: actions/checkout@v6 |
| 30 | - name: Build V |
| 31 | run: make -j4 && ./v symlink |
| 32 | |
| 33 | - name: Install dependencies |
| 34 | run: | |
| 35 | .github/workflows/disable_azure_mirror.sh |
| 36 | v retry -- sudo apt update |
| 37 | v retry -- sudo apt install build-essential -y |
| 38 | |
| 39 | - name: Clone current Vinix |
| 40 | run: v retry -- git clone --depth=1 --branch master https://github.com/vlang/vinix.git |
| 41 | |
| 42 | - name: Download Vinix kernel dependencies |
| 43 | run: cd vinix/kernel && v retry -- ./get-deps |
| 44 | |
| 45 | - name: Attempt to build the Vinix kernel (debug) |
| 46 | run: | |
| 47 | set -e |
| 48 | cd vinix/kernel |
| 49 | make PROD=false \ |
| 50 | CFLAGS="-Ulinux -U__linux -U__linux__ -U__gnu_linux__ -D__vinix__ -O2 -g -pipe" \ |
| 51 | V="$(realpath ../../v)" |
| 52 | make clean |
| 53 | |
| 54 | - name: Attempt to build the Vinix kernel (prod) |
| 55 | run: | |
| 56 | set -e |
| 57 | cd vinix/kernel |
| 58 | make PROD=true \ |
| 59 | CFLAGS="-Ulinux -U__linux -U__linux__ -U__gnu_linux__ -D__vinix__ -O2 -g -pipe" \ |
| 60 | V="$(realpath ../../v)" |
| 61 | make clean |
| 62 | |
| 63 | - name: Attempt to build the util-vinix (debug) |
| 64 | run: | |
| 65 | set -e |
| 66 | cd vinix/util-vinix |
| 67 | make PROD=false \ |
| 68 | VFLAGS="-os vinix -gc none" \ |
| 69 | CFLAGS="-Ulinux -U__linux -U__linux__ -U__gnu_linux__ -D__vinix__ -O2 -g -pipe" \ |
| 70 | V="$(realpath ../../v)" |
| 71 | make clean |
| 72 | |
| 73 | - name: Attempt to build the util-vinix (prod) |
| 74 | run: | |
| 75 | set -e |
| 76 | cd vinix/util-vinix |
| 77 | make PROD=true \ |
| 78 | VFLAGS="-os vinix -gc none" \ |
| 79 | CFLAGS="-Ulinux -U__linux -U__linux__ -U__gnu_linux__ -D__vinix__ -O2 -g -pipe" \ |
| 80 | V="$(realpath ../../v)" |
| 81 | make clean |
| 82 | |