mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Switch to GitHub Actions CI.
This commit is contained in:
45
.github/workflows/ci.yml
vendored
Normal file
45
.github/workflows/ci.yml
vendored
Normal file
@@ -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
|
||||
34
.travis.yml
34
.travis.yml
@@ -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
|
||||
@@ -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"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
[](https://github.com/StevenBlack/hosts/blob/master/license.txt)
|
||||
[](https://github.com/StevenBlack/hosts)
|
||||
[](https://github.com/StevenBlack/hosts/graphs/contributors)
|
||||
[](https://travis-ci.org/StevenBlack/hosts)
|
||||
[](https://github.com/StevenBlack/hosts/actions?workflow=CI)
|
||||
[](https://github.com/python/black)
|
||||
[](https://github.com/StevenBlack/hosts/commits/master)
|
||||
[](https://github.com/StevenBlack/hosts/commits/master)
|
||||
|
||||
Reference in New Issue
Block a user