Skip to content

use shr and sar on x86 in builder versions #51

use shr and sar on x86 in builder versions

use shr and sar on x86 in builder versions #51

Workflow file for this run

name: CI
on:
push:
branches:
- "**"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install formatting tools
run: |
sudo apt-get update
sudo apt-get install -y clang-format clang-tidy
- name: Run clang-format
run: ./scripts/clang-format-check.sh
- name: Run clang-tidy
run: |
clang-tidy src/ctx.c --warnings-as-errors=* --checks=-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -- -std=c11 -Isrc
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-gcc-x86
os: ubuntu-latest
cc: gcc
arch: x86_64
codegen_script: codegen/x86_encoder.js
harness: tests/test_harness_x86.c
- name: ubuntu-clang-x86
os: ubuntu-latest
cc: clang
arch: x86_64
codegen_script: codegen/x86_encoder.js
harness: tests/test_harness_x86.c
install_clang: true
- name: ubuntu-gcc-arm64
os: ubuntu-24.04-arm
cc: gcc
arch: arm64
codegen_script: codegen/arm64_encoder.js
harness: tests/test_harness_arm64.c
- name: ubuntu-clang-arm64
os: ubuntu-24.04-arm
cc: clang
arch: arm64
codegen_script: codegen/arm64_encoder.js
harness: tests/test_harness_arm64.c
install_clang: true
- name: macos-clang-arm64
os: macos-latest
cc: clang
arch: arm64
codegen_script: codegen/arm64_encoder.js
harness: tests/test_harness_arm64.c
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install clang
if: matrix.install_clang && startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y clang
- name: Install Node dependencies
run: npm ci
- name: Regenerate backend
run: node ${{ matrix.codegen_script }}
- name: Build library
run: make dev
env:
CC: ${{ matrix.cc }}
- name: Build and run architecture-specific test harness
run: |
${{ matrix.cc }} -std=c11 -O2 -Isrc ${{ matrix.harness }} src/ctx.c -o jit_tests
./jit_tests
- name: Build and run builder test harness
run: |
${{ matrix.cc }} -std=c11 -O2 -Isrc tests/test_harness_builder.c src/ctx.c -o jit_tests_builder
./jit_tests_builder
- name: Build and run minilang example
timeout-minutes: 1
run: |
${{ matrix.cc }} -std=c11 -O2 -Isrc examples/minilang.c src/ctx.c -o minilang_example
./minilang_example "(def main (x) (add 10 (call dec x))) (def dec (y) (sub y 1))" 10
- name: Build and run SIMD example
run: |
${{ matrix.cc }} -std=c11 -O2 -Isrc examples/simd.c src/ctx.c -o simd_example
./simd_example