quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

ci.yml (7584B)


      1 name: ci
      2 
      3 on:
      4   pull_request:
      5     paths:
      6       - '**'
      7       - '!.gitignore'
      8       - '!LICENSE'
      9       - '!TODO'
     10       - '!doc/**'
     11       - '!examples/**'
     12       - '.github/workflows/ci.yml'
     13   push:
     14     branches:
     15       - '*'
     16 
     17 jobs:
     18   linux:
     19     name: Linux (Ubuntu)
     20     runs-on: ubuntu-latest
     21     strategy:
     22       fail-fast: false
     23     steps:
     24       - uses: actions/checkout@v4
     25         with:
     26           submodules: true
     27       - name: Build
     28         run: |
     29           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
     30       - name: Stats
     31         run: |
     32           ./qjs -qd
     33       - name: Run built-in tests
     34         run: |
     35           make test
     36       - name: Run microbench
     37         run: |
     38           make microbench
     39       - name: Run test262
     40         run: |
     41           make test2-bootstrap
     42           make test2
     43 
     44   linux-lto:
     45     name: Linux LTO
     46     runs-on: ubuntu-latest
     47     strategy:
     48       fail-fast: false
     49     steps:
     50       - uses: actions/checkout@v4
     51         with:
     52           submodules: true
     53       - name: Build
     54         run: |
     55           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_LTO=y
     56       - name: Run built-in tests
     57         run: |
     58           make test
     59       - name: Run microbench
     60         run: |
     61           make microbench
     62 
     63   linux-32bit:
     64     name: Linux 32bit
     65     runs-on: ubuntu-latest
     66     strategy:
     67       fail-fast: false
     68     steps:
     69       - uses: actions/checkout@v4
     70         with:
     71           submodules: true
     72       - name: Install gcc-multilib
     73         run: |
     74           sudo apt update
     75           sudo apt install -y gcc-multilib
     76       - name: Build
     77         run: |
     78           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_M32=y
     79       - name: Run built-in tests
     80         run: |
     81           make CONFIG_M32=y test
     82       - name: Run test262
     83         run: |
     84           make test2-bootstrap
     85           make CONFIG_M32=y test2
     86 
     87   linux-asan:
     88     runs-on: ubuntu-latest
     89     steps:
     90       - uses: actions/checkout@v4
     91         with:
     92           submodules: true
     93       - name: Build
     94         run: |
     95           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
     96       - name: Run built-in tests
     97         env:
     98           ASAN_OPTIONS: halt_on_error=1
     99         run: |
    100           make CONFIG_ASAN=y test
    101 
    102   linux-msan:
    103     runs-on: ubuntu-latest
    104     steps:
    105       - uses: actions/checkout@v4
    106         with:
    107           submodules: true
    108       - name: Build
    109         env:
    110           CC: clang
    111         run: |
    112           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y
    113       - name: Run built-in tests
    114         env:
    115           MSAN_OPTIONS: halt_on_error=1
    116         run: |
    117           make CONFIG_MSAN=y CONFIG_CLANG=y test
    118 
    119   linux-ubsan:
    120     runs-on: ubuntu-latest
    121     steps:
    122       - uses: actions/checkout@v4
    123         with:
    124           submodules: true
    125       - name: Build
    126         run: |
    127           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
    128       - name: Run built-in tests
    129         env:
    130           UBSAN_OPTIONS: halt_on_error=1
    131         run: |
    132           make CONFIG_UBSAN=y test
    133 
    134   macos:
    135     name: macOS
    136     runs-on: macos-latest
    137     strategy:
    138       fail-fast: false
    139     steps:
    140       - uses: actions/checkout@v4
    141       - name: Build
    142         run: |
    143           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
    144       - name: Stats
    145         run: |
    146           ./qjs -qd
    147       - name: Run built-in tests
    148         run: |
    149           make test
    150       - name: Run test262
    151         run: |
    152           make test2-bootstrap
    153           make test2
    154 
    155   macos-asan:
    156     runs-on: macos-latest
    157     steps:
    158       - uses: actions/checkout@v4
    159       - name: Build
    160         run: |
    161           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
    162       - name: Run built-in tests
    163         env:
    164           ASAN_OPTIONS: halt_on_error=1
    165         run: |
    166           make CONFIG_ASAN=y test
    167 
    168   macos-ubsan:
    169     runs-on: macos-latest
    170     steps:
    171       - uses: actions/checkout@v4
    172       - name: Build
    173         run: |
    174           make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
    175       - name: Run built-in tests
    176         env:
    177           UBSAN_OPTIONS: halt_on_error=1
    178         run: |
    179           make CONFIG_UBSAN=y test
    180 
    181   freebsd:
    182     runs-on: ubuntu-latest
    183     steps:
    184       - uses: actions/checkout@v4
    185       - name: Build + test
    186         uses: vmactions/freebsd-vm@v1
    187         with:
    188           usesh: true
    189           copyback: false
    190           mem: 16384
    191           prepare: |
    192             pkg install -y gmake
    193           run: |
    194             gmake
    195             ./qjs -qd
    196             gmake test
    197 
    198   cosmopolitan:
    199     name: Cosmopolitan
    200     runs-on: ubuntu-latest
    201     strategy:
    202       fail-fast: false
    203     steps:
    204       - uses: actions/checkout@v4
    205         with:
    206           submodules: true
    207       - name: Install Cosmopolitan
    208         run: |
    209           mkdir ~/cosmocc
    210           cd ~/cosmocc
    211           wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
    212           unzip cosmocc.zip
    213           echo "$HOME/cosmocc/bin" >> "$GITHUB_PATH"
    214       - name: Build
    215         run: |
    216           make CONFIG_COSMO=y
    217       - name: Run built-in tests
    218         run: |
    219           make CONFIG_COSMO=y test
    220       - name: Run test262
    221         run: |
    222           make test2-bootstrap
    223           make CONFIG_COSMO=y test2
    224 
    225   mingw-windows:
    226     name: MinGW Windows target
    227     runs-on: ubuntu-latest
    228     strategy:
    229       fail-fast: false
    230     steps:
    231       - uses: actions/checkout@v4
    232         with:
    233           submodules: true
    234       - name: Install MinGW and Wine
    235         run: |
    236           sudo apt update
    237           sudo apt install -y wine mingw-w64
    238           cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll .
    239       - name: Setup Wine
    240         run: |
    241           wine --version
    242           winecfg /v
    243           # binfmt doesn't work in GitHub Actions
    244           #sudo apt install -y binfmt-support wine-binfmt
    245           #echo ":Wine:M::MZ::/usr/bin/wine:" > /etc/binfmt.d/wine.conf
    246           #sudo systemctl restart systemd-binfmt
    247       - name: Build
    248         run: |
    249           make CONFIG_WIN32=y
    250       - name: Run built-in tests
    251         run: |
    252           # If binfmt support worked, could just run `make CONFIG_WIN32=y test`
    253           make WINE=/usr/bin/wine CONFIG_WIN32=y test
    254 
    255   windows-msys:
    256     name: Windows MSYS2
    257     runs-on: windows-latest
    258     defaults:
    259       run:
    260         shell: msys2 {0}
    261     steps:
    262       - uses: actions/checkout@v4
    263       - uses: msys2/setup-msys2@v2
    264         with:
    265           msystem: UCRT64
    266           update: true
    267           install: git make mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-dlfcn
    268       - name: Build
    269         run: |
    270            make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
    271       - name: Stats
    272         run: |
    273           ./qjs -qd
    274       - name: Run built-in tests
    275         run: |
    276           make test
    277       - name: Run microbench
    278         run: |
    279           make microbench
    280 
    281 
    282   qemu-alpine:
    283     runs-on: ubuntu-latest
    284 
    285     strategy:
    286       fail-fast: false
    287       matrix:
    288         platform:
    289           - linux/386
    290           - linux/riscv64
    291           - linux/arm64
    292           - linux/arm/v6
    293           - linux/arm/v7
    294           - linux/s390x
    295           - linux/ppc64le
    296 
    297     steps:
    298       - uses: actions/checkout@v4
    299         with:
    300             submodules: recursive
    301       - name: Get qemu
    302         # See https://github.com/tonistiigi/binfmt/issues/215#issuecomment-2613004741
    303         run: docker run --privileged --rm tonistiigi/binfmt:master --install all
    304       - name: Run tests on ${{ matrix.platform }}
    305         run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host --platform ${{ matrix.platform }} alpine sh -c "apk add git patch make gcc libc-dev && cd /host && make test"