name: pystan

on: [push, pull_request]

jobs:
  tests:
    name: pystan tests
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    strategy:
      matrix:
        os: [ubuntu-20.04, macos-10.15]
        python-version: [3.7, 3.8, 3.9]
    steps:
      - name: Check out repository
        uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install poetry
        run: pip install "poetry~=1.1.4"

      # export test dependencies from pyproject.toml, install them
      - name: Install dependencies
        run: |
          poetry export -f requirements.txt --without-hashes --dev -o requirements.txt \
          && pip install -r requirements.txt

      - name: Build and Install wheel
        run: |
          poetry build -v
          python -m pip install dist/*.whl

      - name: Check code
        if: matrix.python-version == '3.8'
        run: scripts/check

      - name: Run tests
        run: scripts/test

name: pystan

on: [push, pull_request]

jobs:
  tests:
    name: pystan tests
    timeout-minutes: 20
    runs-on: ${{ matrix.runs-on }}
    strategy:
      matrix:
        include:
          - {runs-on: ubuntu-20.04, python-version: 3.7}
          - {runs-on: ubuntu-20.04, python-version: 3.8}
          - {runs-on: ubuntu-20.04, python-version: 3.9}
          - {runs-on: macos-10.15, python-version: 3.7}
          - {runs-on: macos-10.15, python-version: 3.8}
          - {runs-on: macos-10.15, python-version: 3.9}
          - {runs-on: ubuntu-20.04, container: "ubuntu:latest", python-version: 3.8}
          - {runs-on: ubuntu-20.04, container: "fedora:latest", python-version: 3.8}

    steps:
      - name: Check out repository
        uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install poetry
        run: pip install "poetry~=1.1.4"

      # export test dependencies from pyproject.toml, install them
      - name: Install dependencies
        run: |
          poetry export -f requirements.txt --without-hashes --dev -o requirements.txt \
          && pip install -r requirements.txt

      - name: Build and Install wheel
        run: |
          poetry build -v
          python -m pip install dist/*.whl

      - name: Check code
        if: matrix.python-version == '3.8'
        run: scripts/check

      - name: Run tests
        run: scripts/test

Test on fedora latest and ubuntu latest
ci: Test on fedora latest and ubuntu latest

Closes #295
