Switch to GitHub Actions CI.
authorXhmikosR <redacted>
Wed, 8 Apr 2020 05:43:45 +0000 (08:43 +0300)
committerXhmikosR <redacted>
Wed, 29 Apr 2020 12:31:54 +0000 (15:31 +0300)
.github/workflows/ci.yml [new file with mode: 0644]
.travis.yml [deleted file]
ci/install_conda.sh
readme_template.md

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644 (file)
index 0000000..41cfd8b
--- /dev/null
@@ -0,0 +1,45 @@
+name: CI
+on: [push, pull_request]
+env:
+  CI: true
+
+jobs:
+  test:
+    runs-on: ${{ matrix.os }}
+
+    strategy:
+      fail-fast: false
+      matrix:
+        python: [3.5, 3.6, 3.7]
+        os: [ubuntu-latest, macos-latest]
+
+    steps:
+      - name: Clone repository
+        uses: actions/checkout@v2
+
+      - name: Set up Python
+        uses: actions/setup-python@v1
+        with:
+          python-version: ${{ matrix.python }}
+          architecture: 'x64'
+
+      - name: Cache dependencies
+        uses: actions/cache@v1
+        with:
+          path: ~/miniconda3
+          key: ${{ runner.os }}-python-v${{ matrix.python }}-${{ hashFiles('ci/*.sh') }}-${{ hashFiles('.github/workflows/ci.yml') }}
+          restore-keys: ${{ runner.os }}-python-v${{ matrix.python }}-${{ hashFiles('ci/*.sh') }}-${{ hashFiles('.github/workflows/ci.yml') }}
+
+      - 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: Run tests
+        run: |
+          export PATH="$HOME/miniconda3/bin:$PATH"
+          ci/test.sh
+          ci/lint.sh
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 15c3ce5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-notifications:
-  email: false
-
-language: generic
-
-cache:
-  directories:
-    - $HOME/miniconda3
-
-before_cache:
-  - rm -rf $HOME/miniconda3/pkgs/cache
-  - rm -rf $HOME/miniconda3/envs/hosts
-  - rm -rf $HOME/miniconda3/conda-meta/history
-  - touch $HOME/miniconda3/conda-meta/history
-
-os:
-  - linux
-  - osx
-
-env:
-  - PYTHON_VERSION="3.5"
-  - PYTHON_VERSION="3.6"
-  - PYTHON_VERSION="3.7"
-
-before_install:
-  - export PATH="$HOME/miniconda3/bin:$PATH"
-
-install:
-  - ci/install_conda.sh
-  - ci/setup_conda_env.sh
-
-script:
-  - ci/test.sh
-  - ci/lint.sh
index d1b196765ac56f17fb2ef2d43df5ab27a3def6ca..2fee2895f0e9cfade8e61287dbea3181586b7400 100755 (executable)
@@ -9,10 +9,10 @@ else
     echo "Installing Miniconda..."
     rm -rf "$HOME"/miniconda3  # Just in case...
 
-    if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
-        wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
+    if [ "$(uname)" == "Darwin" ]; then
+        wget -nv https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
     else
-        wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
+        wget -nv https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
     fi
 
     bash miniconda.sh -b -p "$HOME/miniconda3"
index 05118aa4a283732c025c907d2768e2bb0ce8358c..ec37d37286cb7dee8786fa5256169e4fbad88fe1 100644 (file)
@@ -10,7 +10,7 @@
 [![license](https://img.shields.io/github/license/StevenBlack/hosts.svg)](https://github.com/StevenBlack/hosts/blob/master/license.txt)
 [![repo size](https://img.shields.io/github/repo-size/StevenBlack/hosts.svg)](https://github.com/StevenBlack/hosts)
 [![contributors](https://img.shields.io/github/contributors/StevenBlack/hosts.svg)](https://github.com/StevenBlack/hosts/graphs/contributors)
-[![Build Status](https://img.shields.io/travis/StevenBlack/hosts/master.svg)](https://travis-ci.org/StevenBlack/hosts)
+[![Build Status](https://img.shields.io/github/workflow/status/StevenBlack/hosts/CI/master)](https://github.com/StevenBlack/hosts/actions?workflow=CI)
 [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
 [![commits since last release](https://img.shields.io/github/commits-since/StevenBlack/hosts/latest.svg)](https://github.com/StevenBlack/hosts/commits/master)
 [![last commit](https://img.shields.io/github/last-commit/StevenBlack/hosts.svg)](https://github.com/StevenBlack/hosts/commits/master)
git clone https://git.99rst.org/PROJECT