From 81f213619d05dd9eb4648271dc1df2cd8b6462d7 Mon Sep 17 00:00:00 2001 From: euri10 Date: Fri, 24 Jul 2020 11:17:39 +0200 Subject: [PATCH] Brings back windows testing to CI (#685) * 1st pass on adding windows vm for CI * 2nd pass, was testing nothing * No arrays * No arrays 2 * No arrays 3 * No arrays 4 * Removed appveyor PATH export * Using scripts on windows CI, will need to write ps1 scripts * Matrix indent * Location of scripts * Hate CI * Why ps1 are ignored * Adding ps1 scripts, was globally ignored * Chmod +x ps1 * Removing uvloop from win reqs * Added install and test.sh scripts, globally ignored wtf * Align win reqs to old .travis file * Run really on windows ? * Lost in matrix.... * Blind ps1 * Blind ps1 2nd pass * Blind ps1 3rd pass * Blind test.ps1 ! * Blind test.ps1 love * Attempt specifying shell explicitely * Try using bash on windows * Detect os for requirements * Use sh comparison * Live debug * Live debug 2 * More echo * More echo * More echo 2 * OSTYPE only in bash * OSTYPE seems to be msys * Using old names for scripts since we dont need to differentiate now between os * Removed echo leftovers from live debugging and indented back to 4 spaces * Correct set * Removin=g unboud variable check * Set -x before pip only * Update install * Set -e Co-authored-by: Tom Christie --- .github/workflows/test-suite.yml | 9 +++++---- requirements_windows.txt | 19 +++++++++++++++++++ scripts/install | 10 ++++++++-- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 requirements_windows.txt diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 2d323e3dd..084e162ea 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -9,13 +9,12 @@ on: jobs: tests: - name: "Python ${{ matrix.python-version }}" - runs-on: "ubuntu-latest" - + name: "Python ${{ matrix.python-version }} ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" strategy: matrix: python-version: ["3.6", "3.7", "3.8"] - + os: [windows-latest, ubuntu-latest] steps: - uses: "actions/checkout@v2" - uses: "actions/setup-python@v1" @@ -23,5 +22,7 @@ jobs: python-version: "${{ matrix.python-version }}" - name: "Install dependencies" run: "scripts/install" + shell: bash - name: "Run tests" run: "scripts/test" + shell: bash diff --git a/requirements_windows.txt b/requirements_windows.txt new file mode 100644 index 000000000..486c96046 --- /dev/null +++ b/requirements_windows.txt @@ -0,0 +1,19 @@ +click +h11 + +# Optional +websockets==8.* +wsproto==0.13.* + +# Testing +autoflake +black +codecov +flake8 +isort +pytest +pytest-cov +requests + +# Efficient debug reload +watchgod>=0.6,<0.7 diff --git a/scripts/install b/scripts/install index 65885a720..b2c9963d2 100755 --- a/scripts/install +++ b/scripts/install @@ -1,9 +1,15 @@ -#!/bin/sh -e +#!/usr/bin/env bash + +set -e # Use the Python executable provided from the `-p` option, or a default. [ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3" -REQUIREMENTS="requirements.txt" +if [ "$OSTYPE" = "linux-gnu" ]; then + REQUIREMENTS="requirements.txt" +elif [ "$OSTYPE" = "msys" ]; then + REQUIREMENTS="requirements_windows.txt" +fi VENV="venv" set -x