name: Benchmark

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.10"]
        os: [ubuntu-20.04]

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}
          cache: pip
          cache-dependency-path: "setup.py"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install --upgrade nujson orjson simplejson
          python -m pip install .

      - name: Tests
        shell: bash
        run: |
          python tests/benchmark.py
