mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-08-24 00:03:00 +02:00
* remove unneeded `CI: true` env var since it's already set by the runner * update to `actions/setup-python@v2` * remove `x64` architecture since it's the default
57 lines
1.3 KiB
YAML
57 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python:
|
|
- 3.5
|
|
- 3.6
|
|
- 3.7
|
|
- 3.8
|
|
- 3.9
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- 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: ${{ 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 Python dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Run lint
|
|
run: flake8
|
|
|
|
- name: Run tests
|
|
run: python testUpdateHostsFile.py
|