name: dist

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        python-version: ["3.10"]
        cpp-version: [g++-12]
    steps:
    - uses: actions/checkout@v2
    - name: Setup Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build
    - name: Testing sdist building
      run: |
        python -m build --sdist
    - name: Testing wheel building
      run: |
        python -m build --wheel
    - name: Testing wheel install
      run: |
        python -m pip install dist/pythran*.whl
    - name: Testing wheel uninstall
      run: |
        python -m pip uninstall --yes pythran
