name: Windows CI

on:
  schedule:
    - cron: "0 6 * * *"
  push:
  pull_request:

jobs:
  ci-tests:
    runs-on: windows-latest
    strategy:
      matrix:
        python-version: ["3.8", "3.9", "3.10", "3.11"]
    name: Windows CI
    steps:
      - name: Check out source repository
        uses: actions/checkout@v3
      - name: Set up Python ${{ matrix.python-version }} environment
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
      # - name: Windows-specific Python environment workaround
      #   run: python -m pip install --upgrade pip==21.3.1
      - name: Python environment report
        run: python -c "import sys; print(sys.version)"
      - name: Run ${{ matrix.python-version }} platform tests (default)
        uses: py-actions/flake8@master
        with:
          path: "tests/test-default.py" # have to restrict because there are other tests with flake8 fails
      - name: Run ${{ matrix.python-version }} platform tests (with args)
        uses: py-actions/flake8@master
        with:
          update-pip: "true"
          ignore: "F401"
          exclude: "tests/test.py"
          max-line-length: "100"
          args: "--quiet"
          path: "tests/test-args.py"
          flake8-version: "main"
          plugins: "flake8-bugbear==22.1.11 flake8-black"