mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 01:14:40 +00:00
233 lines
9.5 KiB
YAML
233 lines
9.5 KiB
YAML
name: CI
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
build_netbsd:
|
|
name: NetBSD Build, Check, and Test
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
PKGSRC_BRANCH: 2024Q1
|
|
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/$(uname -p)/$(uname -r | cut -d_ -f1)_${PKGSRC_BRANCH}/All" /usr/sbin/pkg_add pkgin
|
|
pkgin -y in gmake git bash python311
|
|
pkgin -y in libxml2 perl zstd
|
|
/usr/sbin/pkg_add https://github.com/andreas-jonsson/llvm17-netbsd-bin/releases/download/pkgsrc-current/llvm-17.0.6.tgz
|
|
/usr/sbin/pkg_add https://github.com/andreas-jonsson/llvm17-netbsd-bin/releases/download/pkgsrc-current/clang-17.0.6.tgz
|
|
ln -s /usr/pkg/bin/python3.11 /usr/bin/python3
|
|
run: |
|
|
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 test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false
|
|
./odin test tests/core/speed.odin -file -all-packages -o:speed -define:ODIN_TEST_FANCY=false
|
|
./odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false
|
|
./odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false
|
|
(cd tests/issues; ./run.sh)
|
|
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 llvm17
|
|
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 test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false
|
|
./odin test tests/core/speed.odin -file -all-packages -o:speed -define:ODIN_TEST_FANCY=false
|
|
./odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false
|
|
./odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false
|
|
(cd tests/issues; ./run.sh)
|
|
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 17
|
|
echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH
|
|
|
|
- name: Download LLVM (MacOS Intel)
|
|
if: matrix.os == 'macos-13'
|
|
run: |
|
|
brew install llvm@17
|
|
echo "/usr/local/opt/llvm@17/bin" >> $GITHUB_PATH
|
|
|
|
- name: Download LLVM (MacOS ARM)
|
|
if: matrix.os == 'macos-14'
|
|
run: |
|
|
brew install llvm@17 wasmtime
|
|
echo "/opt/homebrew/opt/llvm@17/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
|
|
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
|
|
- name: Normal Core library tests
|
|
run: ./odin test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false
|
|
- name: Optimized Core library tests
|
|
run: ./odin test tests/core/speed.odin -o:speed -file -all-packages -define:ODIN_TEST_FANCY=false
|
|
- name: Vendor library tests
|
|
run: ./odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false
|
|
- name: Internals tests
|
|
run: ./odin test tests/internal -all-packages -define:ODIN_TEST_FANCY=false
|
|
- name: Core library benchmarks
|
|
run: ./odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false
|
|
- name: GitHub Issue tests
|
|
run: |
|
|
cd tests/issues
|
|
./run.sh
|
|
|
|
- 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: Run demo on WASI WASM32
|
|
run: |
|
|
./odin build examples/demo -target:wasi_wasm32 -vet -strict-style -disallow-do -out:demo.wasm
|
|
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
|
|
- 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 -strict-style
|
|
- 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 -define:ODIN_TEST_FANCY=false
|
|
- 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 -define:ODIN_TEST_FANCY=false
|
|
- name: Core library benchmarks
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
|
odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false
|
|
- name: Vendor library tests
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
|
|
odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false
|
|
- 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 -define:ODIN_TEST_FANCY=false
|
|
- 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
|