diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 0c80283d..2cbc4e58 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,12 +21,46 @@ jobs: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10"] - os: [ubuntu-latest, macos-latest] # [ubuntu-latest, macos-latest, windows-latest] + os: [windows-latest] # [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup WSL (Windows) + if: startsWith(matrix.os, 'windows') + uses: Vampire/setup-wsl@v3 + with: + distribution: Ubuntu-22.04 + wsl-shell-command: bash + - name: Setup Python on WSL + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + pwd + sudo apt-get update -y + sudo apt-get install -y python3-pip + sudo apt-get install -y python3.10-venv + - name: Update WSL (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y lsb-release curl gpg + - name: Fetch Redis gpg (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg + - name: Configure Redis gpg (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list + - name: Install Redis (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y redis && sleep 5 && sudo service redis-server stop - name: Update Ubuntu and Install Dependencies if: startsWith(matrix.os, 'ubuntu') run: | @@ -51,7 +85,17 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install dependencies (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + python3 -m pip install --upgrade pip build + - name: Install dependencies (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') + run: | + python -m pip install --upgrade pip build + - name: Install dependencies (macOS) + if: startsWith(matrix.os, 'macos') run: | python -m pip install --upgrade pip build - name: Install package (Ubuntu) @@ -62,8 +106,26 @@ jobs: if: startsWith(matrix.os, 'macos') run: | pip install -e .[tests,lint] - - - name: Test with pytest + - name: Install package (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + python3 -m pip install --upgrade pip setuptools + python3 -m pip install build + python3 -m pip install flake8 pytest + python3 -m build + python3 -m pip install -e .[tests,lint] --no-binary pyzmq + - name: Test with pytest (Windows) + if: startsWith(matrix.os, 'windows') + shell: wsl-bash {0} + run: | + python3 -m pytest --cov=improv + - name: Test with pytest (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') + run: | + python -m pytest --cov=improv + - name: Test with pytest (macOS) + if: startsWith(matrix.os, 'macos') run: | python -m pytest --cov=improv