name: WebScripts Tests
on:
  push:
    branches:
      - main
      - master
  pull_request:
    branches:
      - main
      - master

jobs:
  build:

    strategy:
      matrix:
        python-version: [3.9, "3.10"]
        os: ["ubuntu-latest", "windows-latest", "macos-latest"]
    
    name: "Run test on ${{ matrix.os }} with ${{ matrix.python-version }}"
    runs-on: "${{ matrix.os }}"
    
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Test WebScripts with unittest
        run: |
          python -m unittest discover -s test -p Test*.py -v
          shopt -s globstar
          chmod 400 **/*.ini **/*.json
          chmod 755 **/config
          python -m WebScripts --test-running
          python -m pip install .
          python -m pip install --force-reinstall --install-option "-pabc" --install-option "-d." .
