Remove miniconda and add Windows CI support
authorXhmikosR <redacted>
Sun, 19 Jul 2020 13:13:56 +0000 (16:13 +0300)
committerXhmikosR <redacted>
Fri, 24 Jul 2020 04:36:17 +0000 (07:36 +0300)
.github/workflows/ci.yml
ci/install_conda.sh [deleted file]
ci/lint.sh [deleted file]
ci/setup_conda_env.sh [deleted file]
ci/test.sh [deleted file]
requirements.txt

index 5544b1e4d8242f3d7a330514ad1de0f4aa5d14aa..86a3e898b4150767b497b10472a6091c2894d0df 100644 (file)
@@ -10,8 +10,15 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python: [3.5, 3.6, 3.7, 3.8]
-        os: [ubuntu-latest, macos-latest]
+        python:
+          - 3.5
+          - 3.6
+          - 3.7
+          - 3.8
+        os:
+          - ubuntu-latest
+          - macos-latest
+          - windows-latest
 
     steps:
       - name: Clone repository
@@ -23,23 +30,28 @@ jobs:
           python-version: ${{ matrix.python }}
           architecture: "x64"
 
+      - run: python --version
+      - run: pip --version
+
+      - name: Get pip cache directory
+        id: pip-cache
+        run: |
+          echo "::set-output name=dir::$(pip cache dir)"
+
       - name: Cache dependencies
         uses: actions/cache@v2
         with:
-          path: ~/miniconda3
-          key: ${{ runner.os }}-python-v${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('ci/*.sh') }}
-          restore-keys: ${{ runner.os }}-python-v${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('ci/*.sh') }}
+          path: ${{ steps.pip-cache.outputs.dir }}
+          key: ${{ runner.os }}-python-v${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-python-v${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }}
+            ${{ runner.os }}-python-v${{ matrix.python }}-
 
-      - name: Install conda
-        env:
-          PYTHON_VERSION: ${{ matrix.python }}
-        run: |
-          export PATH="$HOME/miniconda3/bin:$PATH"
-          ci/install_conda.sh
-          ci/setup_conda_env.sh
+      - name: Install Python dependencies
+        run: pip install -r requirements.txt
+
+      - name: Run lint
+        run: flake8 --max-line-length 120
 
       - name: Run tests
-        run: |
-          export PATH="$HOME/miniconda3/bin:$PATH"
-          ci/lint.sh
-          ci/test.sh
+        run: python testUpdateHostsFile.py
diff --git a/ci/install_conda.sh b/ci/install_conda.sh
deleted file mode 100755 (executable)
index 2fee289..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if [ -d "$HOME/miniconda3" ] && [ -e "$HOME/miniconda3/bin/conda" ]; then
-    echo "Miniconda install already present in cache: $HOME/miniconda3"
-    rm -rf "$HOME"/miniconda3/envs/hosts  # Just in case...
-else
-    echo "Installing Miniconda..."
-    rm -rf "$HOME"/miniconda3  # Just in case...
-
-    if [ "$(uname)" == "Darwin" ]; then
-        wget -nv https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
-    else
-        wget -nv https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
-    fi
-
-    bash miniconda.sh -b -p "$HOME/miniconda3"
-fi
-
-echo "Configuring Miniconda..."
-conda config --set ssl_verify false
-conda config --set always_yes true --set changeps1 false
-
-echo "Updating Miniconda"
-conda update conda
-conda update --all
-conda info -a
diff --git a/ci/lint.sh b/ci/lint.sh
deleted file mode 100755 (executable)
index adb9be9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Linting repository..."
-source activate hosts
-
-flake8 --max-line-length 120
diff --git a/ci/setup_conda_env.sh b/ci/setup_conda_env.sh
deleted file mode 100755 (executable)
index e6a39d4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Creating a Python $PYTHON_VERSION environment"
-conda create -n hosts python="$PYTHON_VERSION"
-source activate hosts
-
-echo "Installing packages..."
-conda install flake8 beautifulsoup4 lxml
diff --git a/ci/test.sh b/ci/test.sh
deleted file mode 100755 (executable)
index 1eef900..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-set -e
-
-echo "Running unit tests..."
-source activate hosts
-
-python --version
-python testUpdateHostsFile.py
index d9f613a85f9b63a0fac3b69630e05c6f421fec88..adc8a4869f04faffbe8d586c3eb27d7db1689dfe 100644 (file)
@@ -1,2 +1,3 @@
 lxml>=4.2.4
 beautifulsoup4>=4.6.1
+flake8>=3.8.3
git clone https://git.99rst.org/PROJECT