name: PyInstaller

on: push

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v1
      - name: Python
        uses: actions/setup-python@v1
        with:
          python-version: '3.9'
      - name: Install
        run: |
          python -m venv venv
          venv/Scripts/pip install pyinstaller
          venv/Scripts/pip install .
      - name: Make exe
        run: |
          echo "from cutadapt.__main__ import main_cli" > script.py
          echo "sys.exit(main_cli())" >> script.py
          venv/Scripts/pyinstaller -F -n cutadapt script.py
      - name: Run it
        run: dist/cutadapt.exe --version
      - name: Test multicore
        run: ( echo ">read" && echo "ACGT" ) | dist/cutadapt.exe -j 2 --quiet -
      - uses: actions/upload-artifact@v2
        with:
          name: cutadapt-exe
          path: dist/cutadapt.exe
