quickjs-rusty 0.11.1

A rusty QuickJS (QuickJS-NG) Javascript engine wrapper, and more.
Documentation
name: CI

on:
  push:
    branches:
      - main
      - feat/*
  pull_request: {}
  release:
    types:
      - created

jobs:
  test:
    name: Test on ${{ matrix.os }} with features ${{ matrix.features }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
    runs-on: ${{ matrix.os }}
    env:
      # Limit test threads to 1 to show test name before execution.
      RUST_TEST_THREADS: 1 

    steps:
    - name: Set git autocrlf to input
      run: |

        git config --global core.autocrlf input

    - uses: actions/checkout@v4
      with:
        submodules: recursive

    - name: Install stable toolchain
      uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
        components: rustfmt, clippy
      # if: matrix.os != 'windows-latest'

    # - name: Install stable toolchain (windows)
    #   uses: actions-rs/toolchain@v1
    #   with:
    #     profile: minimal
    #     toolchain: stable
    #     target: x86_64-pc-windows-gnu
    #     override: true
    #   if: matrix.os == 'windows-latest'

    - name: Install `just` command runner
      uses: extractions/setup-just@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    - name: Setup (debian)
      run: |

        echo "Install system tools"
        sudo apt-get update -y
        sudo apt-get install -y curl xz-utils build-essential gcc-multilib valgrind
      if: matrix.os == 'ubuntu-latest'

    # - name: Setup (windows)
    #   run: |
    #     $env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$env:PATH"
    #     echo "PATH=${env:PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
    #     echo "CARGO_BUILD_TARGET=x86_64-pc-windows-gnu" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
    #   if: matrix.os == 'windows-latest'

    - name: Build (default features)
      env:
        FEATURES: ""
      run: |

        cargo clean
        just FEATURES="$FEATURES" build

    - name: Test (default features)
      env:
        FEATURES: ""
      run: |

        just FEATURES="$FEATURES" test

    # - name: Build (--no-default-features)
    #   env:
    #     FEATURES: "--no-default-features"
    #   run: |
    #     cargo clean
    #     just FEATURES="$FEATURES" build

    # - name: Test (--no-default-features)
    #   env:
    #     FEATURES: "--no-default-features"
    #   run: |
    #     just FEATURES="$FEATURES" test

    - name: Build (--all-features)
      env:
        FEATURES: "--all-features"
      run: |

        cargo clean
        just FEATURES="$FEATURES" build

    - name: Test (--all-features)
      env:
        FEATURES: "--all-features"
      run: |

        just FEATURES="$FEATURES" test

    - name: Lint
      run: just lint
      if: matrix.os == 'ubuntu-latest'

    # - name: Check for leaks (Valgrind)
    #   run: just valgrind
    #   if: matrix.os == 'ubuntu-latest'