Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ freebsd_task:
- opam install -t ocaml-solo5 --deps-only
build_script: opam reinstall -t ocaml-solo5
test_script:
- MODE=hvt opam exec -- dune build --root example
- MODE=hvt opam exec -- dune build --root example --display short
39 changes: 28 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: Test
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
matrix:
runner:
- ubuntu-latest
- ubuntu-24.04-arm
ocaml-compiler:
- 5.4.1
- 5.5.0
name: OCaml ${{ matrix.ocaml-compiler }}
runs-on: ubuntu-latest
include:
- runner: ubuntu-latest
ocaml-compiler: 5.4.1
name: >-
OCaml ${{ matrix.ocaml-compiler }}
${{ case(matrix.runner=='ubuntu-latest', 'x86_64', 'arm64') }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v7
- uses: ocaml/setup-ocaml@v3
Expand All @@ -18,29 +29,35 @@ jobs:
*.opam
!ocaml-solo5-cross-aarch64.opam
- name: Install ocaml-solo5 and dune
run: opam install ocaml-solo5 conf-libseccomp dune fmt
run: |
opam install conf-libseccomp dune fmt \
ocaml-solo5 --verbose-on=ocaml-solo5
- name: Show the toolchain configuration
run: |
set -x
opam exec -- ocamlfind -toolchain solo5 opt -config
opam exec -- ocamlfind -toolchain solo5 printconf
opam exec -- ocamlfind -toolchain solo5 list
- name: Compile examples with hvt
run: MODE=hvt opam exec -- dune build --root example
run: MODE=hvt opam exec -- dune build --root example --display short
- name: Run the hello example with hvt
run: |
set -x
MODE=hvt opam exec -- dune describe location --root example \
--context solo5 --no-print-directory ./hello.exe |& tee hello.path
sudo setfacl -m u:${USER}:rw /dev/kvm
opam exec -- solo5-hvt -- "example/$(cat hello.path)"
if: matrix.runner == 'ubuntu-latest'
- name: Compile examples with spt
run: MODE=spt opam exec -- dune build --root example
run: MODE=spt opam exec -- dune build --root example --display short
- name: Run examples with spt
run: MODE=spt opam exec -- dune runtest --root example
run: MODE=spt opam exec -- dune runtest --root example _build/solo5
- name: Compile examples with virtio
run: MODE=virtio opam exec -- dune build --root example
run: MODE=virtio opam exec -- dune build --root example --display short
if: matrix.runner == 'ubuntu-latest'
- name: Compile examples with muen
run: MODE=muen opam exec -- dune build --root example
run: MODE=muen opam exec -- dune build --root example --display short
if: matrix.runner == 'ubuntu-latest'
- name: Compile examples with xen
run: MODE=xen opam exec -- dune build --root example
run: MODE=xen opam exec -- dune build --root example --display short
if: matrix.runner == 'ubuntu-latest'
7 changes: 7 additions & 0 deletions openlibm/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
93 changes: 93 additions & 0 deletions openlibm/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- run: make
- run: make test
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { sys: mingw64, env: x86_64 }
- { sys: mingw32, env: i686 }
- { sys: ucrt64, env: ucrt-x86_64 } # Experimental!
- { sys: clang64, env: clang-x86_64 } # Experimental!
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- name: Set up the desired MSYS2 environment
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: base-devel mingw-w64-${{matrix.env}}-toolchain
- run: make
- run: make test
code-coverage-old:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Build and Run tests
run: make coverage -j
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v5
# with:
# files: ./cov-html/libopenlibm.info
# token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: code-coverage-report-old
path: ./cov-html/
code-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Openlibm
uses: actions/checkout@v4
- name: Checkout Openlibm-test
uses: actions/checkout@v4
with:
repository: 'JuliaMath/openlibm-test'
path: 'openlibm-test'
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Build Openlibm
run: make -j`nproc` CODE_COVERAGE=1
- name: Run Test
run: |
make -j`nproc` -C openlibm-test \
USE_OPENLIBM=1 OPENLIBM_HOME="$(pwd)" \
SKIP_FP_EXCEPT_TEST=1 \
- name: Show Test Result
run: cat openlibm-test/src/REPORT
- name: Gen Coverage Report
run: make gen-cov-report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./cov-html/libopenlibm.info
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ./cov-html/
54 changes: 54 additions & 0 deletions openlibm/.github/workflows/cross-loongarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# merge this file into cross.yml
# when we can `sudo apt install gcc-loongarch64-linux-gnu` on ubuntu
name: Cross

on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'

jobs:
build-cross-qemu:
# TODO: We need Ubuntu 24.04 to use newer version of qemu,
# switch to ubuntu-latest when `ubuntu-latest >= 24.04`
runs-on: ubuntu-24.04
name: build-cross-qemu-${{ matrix.config.arch }}
strategy:
fail-fast: false
matrix:
config:
- { arch: loongarch64, triple: loongarch64-linux-gnu }
env:
ARCH: ${{ matrix.config.arch }}
TRIPLE: ${{ matrix.config.triple }}
steps:
- uses: actions/checkout@v4
- name: Install qemu
run: |
sudo apt update
sudo apt install -y qemu-user qemu-user-binfmt
- name: Install gcc-${{ matrix.config.triple }}
# package gcc-loongarch64-linux-gnu seems not exist
# https://packages.debian.org/sid/amd64/gcc-loongarch64-linux-gnu
run: sudo apt install -y gcc-14-loongarch64-linux-gnu
- name: Build with ${{ matrix.config.triple }}-gcc
run: |
make ARCH=$ARCH TOOLPREFIX=$TRIPLE- \
CC='loongarch64-linux-gnu-gcc-14' \
AR='loongarch64-linux-gnu-gcc-ar-14' \
- name: Build tests
run: |
make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE- \
CC='loongarch64-linux-gnu-gcc-14' \
AR='loongarch64-linux-gnu-gcc-ar-14' \
- name: Run Tests
env:
QEMU_EXEC: qemu-${{ matrix.config.arch }}
CROSS_LIB: /usr/${{ matrix.config.triple }}
run: |
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-double
53 changes: 53 additions & 0 deletions openlibm/.github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Cross

on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'

jobs:
build-cross-qemu:
# TODO: We need Ubuntu 24.04 to use newer version of qemu,
# switch to ubuntu-latest when `ubuntu-latest >= 24.04`
runs-on: ubuntu-24.04
name: build-cross-qemu-${{ matrix.config.arch }}
strategy:
fail-fast: false
matrix:
config:
- { arch: arm, triple: arm-linux-gnueabihf }
- { arch: aarch64, triple: aarch64-linux-gnu }
- { arch: ppc, triple: powerpc-linux-gnu }
- { arch: ppc64, triple: powerpc64-linux-gnu }
- { arch: ppc64le, triple: powerpc64le-linux-gnu }
- { arch: mips, triple: mips-linux-gnu }
- { arch: mipsel, triple: mipsel-linux-gnu }
# Builds successfully, but tests fail.
# - { arch: mips64, triple: mips64-linux-gnuabi64 }
# - { arch: mips64el, triple: mips64el-linux-gnuabi64 }
- { arch: riscv64, triple: riscv64-linux-gnu }
- { arch: s390x, triple: s390x-linux-gnu }
env:
ARCH: ${{ matrix.config.arch }}
TRIPLE: ${{ matrix.config.triple }}
steps:
- uses: actions/checkout@v4
- name: Install qemu and toolchain gcc-${{ matrix.config.triple }}
run: |
sudo apt update
sudo apt install qemu-user qemu-user-binfmt gcc-$TRIPLE -y
- name: Build with ${{ matrix.config.triple }}-gcc
run: make ARCH=$ARCH TOOLPREFIX=$TRIPLE-
- name: Build tests
run: make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE-
- name: Run Tests
env:
QEMU_EXEC: qemu-${{ matrix.config.arch }}
CROSS_LIB: /usr/${{ matrix.config.triple }}
run: |
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-double
6 changes: 6 additions & 0 deletions openlibm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
*.so*
*.dylib*
*.pc

# code coverage
openlibm-test
cov-html/
*.gcda
*.gcno
73 changes: 0 additions & 73 deletions openlibm/.travis.yml

This file was deleted.

Loading