123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- name: CI
- on: [push, pull_request, workflow_dispatch]
- jobs:
- build_netbsd:
- name: NetBSD Build, Check, and Test
- runs-on: ubuntu-latest
- env:
- PKGSRC_BRANCH: 2024Q3
- steps:
- - uses: actions/checkout@v4
- - name: Build, Check, and Test
- timeout-minutes: 15
- uses: vmactions/netbsd-vm@v1
- with:
- release: "10.0"
- envs: PKGSRC_BRANCH
- usesh: true
- copyback: false
- prepare: |
- PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin
- pkgin -y in gmake git bash python311 llvm clang
- ln -s /usr/pkg/bin/python3.11 /usr/bin/python3
- run: |
- set -e -x
- git config --global --add safe.directory $(pwd)
- gmake release
- ./odin version
- ./odin report
- gmake -C vendor/stb/src
- gmake -C vendor/cgltf/src
- gmake -C vendor/miniaudio/src
- ./odin check examples/all -vet -strict-style -disallow-do -target:netbsd_amd64
- ./odin check examples/all -vet -strict-style -disallow-do -target:netbsd_arm64
- ./odin check vendor/sdl3 -vet -strict-style -disallow-do -target:netbsd_amd64 -no-entry-point
- ./odin check vendor/sdl3 -vet -strict-style -disallow-do -target:netbsd_arm64 -no-entry-point
- ./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- ./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- ./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- (cd tests/issues; ./run.sh)
- ./odin check tests/benchmark -vet -strict-style -no-entry-point
- build_freebsd:
- name: FreeBSD Build, Check, and Test
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Build, Check, and Test
- timeout-minutes: 15
- uses: vmactions/freebsd-vm@v1
- with:
- usesh: true
- copyback: false
- prepare: |
- pkg install -y gmake git bash python3 libxml2 llvm18
- run: |
- # `set -e` is needed for test failures to register. https://github.com/vmactions/freebsd-vm/issues/72
- set -e -x
- git config --global --add safe.directory $(pwd)
- gmake release
- ./odin version
- ./odin report
- gmake -C vendor/stb/src
- gmake -C vendor/cgltf/src
- gmake -C vendor/miniaudio/src
- ./odin check examples/all -vet -strict-style -disallow-do -target:freebsd_amd64
- ./odin check vendor/sdl3 -vet -strict-style -disallow-do -target:freebsd_amd64 -no-entry-point
- ./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- ./odin test tests/core/speed.odin -file -all-packages -vet -strict-style -disallow-do -o:speed -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- ./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- (cd tests/issues; ./run.sh)
- ./odin check tests/benchmark -vet -strict-style -no-entry-point
- ci:
- strategy:
- fail-fast: false
- matrix:
- # MacOS 13 runs on Intel, 14 runs on ARM
- os: [ubuntu-latest, macos-13, macos-14]
- runs-on: ${{ matrix.os }}
- name: ${{ matrix.os == 'macos-14' && 'MacOS ARM' || (matrix.os == 'macos-13' && 'MacOS Intel' || 'Ubuntu') }} Build, Check, and Test
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - name: Download LLVM (Linux)
- if: matrix.os == 'ubuntu-latest'
- run: |
- wget https://apt.llvm.org/llvm.sh
- chmod +x llvm.sh
- sudo ./llvm.sh 20
- echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH
- - name: Download LLVM (MacOS Intel)
- if: matrix.os == 'macos-13'
- run: |
- brew update
- brew install llvm [email protected] lld
- brew --prefix llvm@20 # Verifies it is LLVM 20
- - name: Download LLVM (MacOS ARM)
- if: matrix.os == 'macos-14'
- run: |
- brew update
- brew install llvm wasmtime [email protected] lld
- brew --prefix llvm@20 # Verifies it is LLVM 20
- - name: Build Odin
- run: ./build_odin.sh release
- - name: Odin version
- run: ./odin version
- - name: Odin report
- run: ./odin report
- - name: Compile needed Vendor
- run: |
- make -C vendor/stb/src
- make -C vendor/cgltf/src
- make -C vendor/miniaudio/src
- - name: Odin check
- run: ./odin check examples/demo -vet
- - name: Odin run
- run: ./odin run examples/demo
- - name: Odin run -debug
- run: ./odin run examples/demo -debug
- - name: Odin check examples/all
- run: ./odin check examples/all -strict-style -vet -disallow-do
- - name: Odin check vendor/sdl3
- run: ./odin check vendor/sdl3 -strict-style -vet -disallow-do -no-entry-point
- - name: Normal Core library tests
- run: ./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Optimized Core library tests
- run: ./odin test tests/core/speed.odin -o:speed -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Vendor library tests
- run: ./odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Internals tests
- run: ./odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: GitHub Issue tests
- run: |
- cd tests/issues
- ./run.sh
- - name: Check benchmarks
- run: ./odin check tests/benchmark -vet -strict-style -no-entry-point
- - name: Odin check examples/all for Linux i386
- run: ./odin check examples/all -vet -strict-style -disallow-do -target:linux_i386
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check examples/all for Linux arm64
- run: ./odin check examples/all -vet -strict-style -disallow-do -target:linux_arm64
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check examples/all for FreeBSD amd64
- run: ./odin check examples/all -vet -strict-style -disallow-do -target:freebsd_amd64
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check examples/all for OpenBSD amd64
- run: ./odin check examples/all -vet -strict-style -disallow-do -target:openbsd_amd64
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check vendor/sdl3 for Linux i386
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_i386
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check vendor/sdl3 for Linux arm64
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:linux_arm64
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check vendor/sdl3 for FreeBSD amd64
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:freebsd_amd64
- if: matrix.os == 'ubuntu-latest'
- - name: Odin check vendor/sdl3 for OpenBSD amd64
- run: ./odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point -target:openbsd_amd64
- if: matrix.os == 'ubuntu-latest'
- - name: Run demo on WASI WASM32
- run: |
- ./odin build examples/demo -target:wasi_wasm32 -vet -strict-style -disallow-do -out:demo
- wasmtime ./demo.wasm
- if: matrix.os == 'macos-14'
- build_windows:
- name: Windows Build, Check, and Test
- runs-on: windows-2022
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - name: build Odin
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- ./build.bat 1
- - name: Odin version
- run: ./odin version
- - name: Odin report
- run: ./odin report
- - name: Odin check
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin check examples/demo -vet
- - name: Odin run
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin run examples/demo
- - name: Odin run -debug
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin run examples/demo -debug -vet -strict-style -disallow-do
- - name: Odin check examples/all
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin check examples/all -vet -strict-style -disallow-do
- - name: Odin check vendor/sdl3
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin check vendor/sdl3 -vet -strict-style -disallow-do -no-entry-point
- - name: Core library tests
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Optimized core library tests
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin test tests/core/speed.odin -o:speed -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Vendor library tests
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- copy vendor\lua\5.4\windows\*.dll .
- odin test tests/vendor -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Odin internals tests
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
- - name: Check issues
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- cd tests/issues
- call run.bat
- - name: Check benchmarks
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin check tests/benchmark -vet -strict-style -no-entry-point
- - name: Odin documentation tests
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- cd tests\documentation
- call build.bat
- - name: core:math/big tests
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- cd tests\core\math\big
- call build.bat
- - name: Odin check examples/all for Windows 32bits
- shell: cmd
- run: |
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
- odin check examples/all -strict-style -target:windows_i386
- build_linux_riscv64:
- runs-on: ubuntu-latest
- name: Linux riscv64 (emulated) Build, Check and Test
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - name: Download LLVM (Linux)
- run: |
- wget https://apt.llvm.org/llvm.sh
- chmod +x llvm.sh
- sudo ./llvm.sh 18
- echo "/usr/lib/llvm-18/bin" >> $GITHUB_PATH
- - name: Build Odin
- run: ./build_odin.sh release
- - name: Odin version
- run: ./odin version
- - name: Odin report
- run: ./odin report
- - name: Compile needed Vendor
- run: |
- make -C vendor/stb/src
- make -C vendor/cgltf/src
- make -C vendor/miniaudio/src
- - name: Odin check examples/all
- run: ./odin check examples/all -target:linux_riscv64 -vet -strict-style -disallow-do
- - name: Odin check vendor/sdl3
- run: ./odin check vendor/sdl3 -target:linux_riscv64 -vet -strict-style -disallow-do -no-entry-point
- - name: Install riscv64 toolchain and qemu
- run: sudo apt-get install -y qemu-user qemu-user-static gcc-12-riscv64-linux-gnu libc6-riscv64-cross
- - name: Odin run
- run: ./odin run examples/demo -vet -strict-style -disallow-do -target:linux_riscv64 -extra-linker-flags:"-fuse-ld=/usr/bin/riscv64-linux-gnu-gcc-12 -static -Wl,-static" -no-rpath
- - name: Odin run -debug
- run: ./odin run examples/demo -debug -vet -strict-style -disallow-do -target:linux_riscv64 -extra-linker-flags:"-fuse-ld=/usr/bin/riscv64-linux-gnu-gcc-12 -static -Wl,-static" -no-rpath
- - name: Normal Core library tests
- run: ./odin test tests/core/normal.odin -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -target:linux_riscv64 -extra-linker-flags:"-fuse-ld=/usr/bin/riscv64-linux-gnu-gcc-12 -static -Wl,-static" -no-rpath
- - name: Optimized Core library tests
- run: ./odin test tests/core/speed.odin -o:speed -file -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -target:linux_riscv64 -extra-linker-flags:"-fuse-ld=/usr/bin/riscv64-linux-gnu-gcc-12 -static -Wl,-static" -no-rpath
- - name: Internals tests
- run: ./odin test tests/internal -all-packages -vet -strict-style -disallow-do -define:ODIN_TEST_FANCY=false -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true -target:linux_riscv64 -extra-linker-flags:"-fuse-ld=/usr/bin/riscv64-linux-gnu-gcc-12 -static -Wl,-static" -no-rpath
|