Merge pull request #942 from minrk/actions

GitHub Actions
pull/919/head^2
Simon Li 2020-08-14 17:44:14 +01:00 zatwierdzone przez GitHub
commit fc74bef9a8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 128 dodań i 122 usunięć

115
.github/workflows/test.yml vendored 100644
Wyświetl plik

@ -0,0 +1,115 @@
# Useful GitHub Actions docs:
#
# - https://help.github.com/en/actions
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# - https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: Continuous Integration
# Only trigger the workflow when pushing to master
on:
- push
- pull_request
# Global environment variables
env:
GIT_COMMITTER_EMAIL: ci-user@github.local
GIT_COMMITTER_NAME: CI User
GIT_AUTHOR_EMAIL: ci-user@github.local
GIT_AUTHOR_NAME: CI User
jobs:
# Job to run linter / autoformat
lint:
runs-on: ubuntu-18.04
steps:
# Action Repo: https://github.com/actions/checkout
- name: "Checkout repo"
uses: actions/checkout@v2
with:
fetch-depth: 0
# Action Repo: https://github.com/actions/setup-python
- name: "Setup Python"
uses: actions/setup-python@v2
with:
python-version: "3.8"
# Action Repo: https://github.com/actions/cache
- name: "Cache pip dependencies"
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: "Install dependencies"
run: |
pip install --upgrade setuptools pip
pip install --upgrade -r dev-requirements.txt
pip freeze
- name: "Run linter"
run: |
pre-commit run --all-files
test:
# Previous job must have successfully completed for this job to execute
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds
needs: lint
runs-on: ubuntu-18.04
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy
strategy:
fail-fast: false # Do not cancel all jobs if one fails
matrix:
python_version: ["3.8"]
repo_type:
- base
- conda
- dockerfile
- external
- julia
- nix
- pipfile
- r
- stencila-py
- unit
- venv
include:
- python_version: "3.5"
repo_type: venv
steps:
- name: "Checkout repo"
uses: actions/checkout@v2
- name: "Setup Python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
# Action Repo: https://github.com/actions/cache
- name: "Cache pip dependencies"
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: "Install"
run: |
pip install --upgrade setuptools pip wheel
pip install --upgrade -r dev-requirements.txt
python setup.py bdist_wheel
pip install dist/*.whl
pip freeze
- name: "Run tests"
run: |
pytest --durations 10 --cov repo2docker -v tests/${{ matrix.repo_type }}
# Action Repo: https://github.com/codecov/codecov-action
- uses: codecov/codecov-action@v1

Wyświetl plik

@ -1,11 +1,11 @@
dist: xenial dist: xenial
os: linux
language: python language: python
sudo: required
cache: pip cache: pip
services: services:
- docker - docker
python: python:
- 3.6 - 3.8
install: install:
# Make a wheel and install it to test to catch possible # Make a wheel and install it to test to catch possible
# issues with releases # issues with releases
@ -20,19 +20,6 @@ script:
if [[ "$REPO_TYPE" == "lint" ]]; then if [[ "$REPO_TYPE" == "lint" ]]; then
pre-commit run --all-files pre-commit run --all-files
fi fi
- |
# run any of the other tests
if [[ "$REPO_TYPE" != "lint" ]]; then
# cd into tests so CWD being repo2docker does not hide
# possible issues with MANIFEST.in
pushd tests;
if [ ${REPO_TYPE} == "r" ] || [ ${REPO_TYPE} == "stencila-r" ] || [ ${REPO_TYPE} == "stencila-py" ]; then
travis_wait 30 pytest --durations 10 --cov repo2docker -v ${REPO_TYPE} || exit 1;
else
travis_retry pytest --durations 10 --cov repo2docker -v ${REPO_TYPE} || exit 1;
fi;
popd;
fi
after_success: after_success:
- pip install codecov - pip install codecov
- pushd tests && codecov && popd - pushd tests && codecov && popd
@ -40,42 +27,20 @@ after_success:
after_failure: after_failure:
- | - |
# point to auto-lint-fix # point to auto-lint-fix
if [[ "$REPO_TYPE" == "lint" ]]; then echo "You can install pre-commit hooks to automatically run formatting"
echo "You can install pre-commit hooks to automatically run formatting" echo "on each commit with:"
echo "on each commit with:" echo " pre-commit install"
echo " pre-commit install" echo "or you can run by hand on staged files with"
echo "or you can run by hand on staged files with" echo " pre-commit run"
echo " pre-commit run" echo "or after-the-fact on already committed files with"
echo "or after-the-fact on already committed files with" echo " pre-commit run --all-files"
echo " pre-commit run --all-files"
fi
env:
matrix:
- REPO_TYPE=lint
- REPO_TYPE=unit
- REPO_TYPE=base
- REPO_TYPE=conda
- REPO_TYPE=pipfile
- REPO_TYPE=venv
- REPO_TYPE=stencila-py
- REPO_TYPE=julia
- REPO_TYPE=r
- REPO_TYPE=nix
- REPO_TYPE=dockerfile
- REPO_TYPE=external
matrix:
include:
- python: 3.5
env:
- REPO_TYPE=venv
deploy: deploy:
provider: pypi provider: pypi
user: mybinderteam username: mybinderteam
distributions: sdist bdist_wheel distributions: sdist bdist_wheel
on: on:
tags: true tags: true
repo: jupyterhub/repo2docker repo: jupyterhub/repo2docker
condition: "$REPO_TYPE = conda"
password: password:
secure: Vcbr4UtckHRjKKhOFKyHkmBQRB9H3SnJvOoxuqXhzCR6JtVe2L1m4UJaSk5aq6CDauZI6fejYhMxJ6W5oqz2q7DH8RnemIVCmTaqTNqblQy6s1XK7iUjtWUtr+MfjFWNx99hqAy9VGVoi++9w4ZaDba448D69rkzVqQTJUjHTlJql66ZIyuPWLhgkWRxMNd5Hnwjf+ETc7efasD2NsvsASsI0AEZijjb+Lbi9V+hR1e1JTn+a8Gz4zskPGVT2kMTobLGE6ucfsYyPy/FxAp5GedEZdAaipjdHmN64ylV8fxDrsCKj4zwD+w43XJzJPJVpqmeYm93SKhWr2v5xn/IGFH/Ea/9/rzFogpDdCUIgv4/xNKgVFVaMalTSUs9aOwYoBVFrmWNkyPSv7vihgWtO2ljo239Eb81SHMiwnbsHG5Ao0XY32USn7CmLO7/BbnY+JVJpNHWoG/jdTn73OzXextGK30f7fp1IxSxhnGdMBkNbKeujOfmhtDj1DIyMM2eNy0YMprv90+d9zxn15PG3TjspXzM6d9wd7BhmuPfMnD6pC51l83S7kmTMJ9nK+WexACpZ0+jwLYsJUnwXClD4S1nZxaEW6cMfSEYFU/l93eyBQqiQC0EjvWCBXwfl8ZMVQr3gr/ZbqCVSaqtINri4JqA3iqHJl3mEdA2WJ5VDZw= secure: ZkJTcI6fVkh2yRB0UVwSPVvGtfade7sQDZ6BjQR5bHRZuBLFq4/nxmn88BIPc6uYEHB6hxxfr9RbyP7ZnyUVUoTiyRfDM8kQe0RvFUVxRj7brZZFMYt6OTMiPUgWvyDqYIdVx+D5qgFgLxnQtUiZ0iqvPgQ+9Jn5SxZuuovrARpaTavlmKo4Vw63Ks/3zV61YeehvELFxU2Ibjy5ujMo/R119KZ7G3Z1w0IyJyVZQ9WaG1VXLO1LjFifpCcjMawaTJ9TmD5BOdF4IAIlP2QlB9N+v2xxuEGy7Mc9FwAH6M8kNqmjhe/ayj83vEMmlkxhE66unqiFJkSXzH1Rh8ythOy9s9qiDgeZeW/rYYLrzVNl9aMHicidV4PKEzobwXS/u8c/wx0fsAMNPcHY+O/8+hFLwy4ZLHusNiyCjPv5sVOq7yM/EKCjkod71bzFOvnnCZ70S0pxrR1nwEKo3x8qaK7l9aw0raSgWyrp6VHzEI4zPfBvP+R2ZYCUqBBj7rrpEl2C02AMKEkTh7Xm5LpaAFCBBMUwTATg7hECmB232vO+C6CLED+ONmGost5jOgsGwIun6viM5eXhP1tCeC5XeAtYozo/9UUIc5yHZL/8YtnmfCxvSi7p6h4qgLDCviKTH3bJCsRjF1ktkTiWAT+wL/SywsRz5D9tjV4b70neM8I=

Wyświetl plik

@ -1,8 +1,8 @@
# <a href="https://github.com/jupyterhub/repo2docker"><img src="https://raw.githubusercontent.com/jupyterhub/repo2docker/3fa7444fca6ae2b51e590cbc9d83baf92738ca2a/docs/source/_static/images/repo2docker.png" height="48px" /> repo2docker</a> # <a href="https://github.com/jupyterhub/repo2docker"><img src="https://raw.githubusercontent.com/jupyterhub/repo2docker/3fa7444fca6ae2b51e590cbc9d83baf92738ca2a/docs/source/_static/images/repo2docker.png" height="48px" /> repo2docker</a>
[![Build Status](https://travis-ci.org/jupyterhub/repo2docker.svg?branch=master)](https://travis-ci.org/jupyterhub/repo2docker) [![Deploy Status](https://travis-ci.org/jupyterhub/repo2docker.svg?branch=master)](https://travis-ci.org/jupyterhub/repo2docker)
[![Build Status](https://github.com/jupyterhub/repo2docker/workflows/Continuous%20Integration/badge.svg)](https://github.com/jupyterhub/repo2docker/actions)
[![Documentation Status](https://readthedocs.org/projects/repo2docker/badge/?version=latest)](http://repo2docker.readthedocs.io/en/latest/?badge=latest) [![Documentation Status](https://readthedocs.org/projects/repo2docker/badge/?version=latest)](http://repo2docker.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://dev.azure.com/jupyterhub/repo2docker/_apis/build/status/jupyter.repo2docker?branchName=master)](https://dev.azure.com/jupyterhub/repo2docker/_build/latest?definitionId=1&branchName=master)
[![Contribute](https://img.shields.io/badge/I_want_to_contribute!-grey?logo=jupyter)](https://repo2docker.readthedocs.io/en/latest/contributing/contributing.html) [![Contribute](https://img.shields.io/badge/I_want_to_contribute!-grey?logo=jupyter)](https://repo2docker.readthedocs.io/en/latest/contributing/contributing.html)
`repo2docker` fetches a git repository and builds a container image based on `repo2docker` fetches a git repository and builds a container image based on

Wyświetl plik

@ -1,74 +0,0 @@
# https://docs.microsoft.com/azure/devops/pipelines/ecosystems/python
pool:
vmImage: "ubuntu-16.04"
strategy:
matrix:
unit:
REPO_TYPE: 'unit'
python_version: '3.6'
base:
REPO_TYPE: 'base'
python_version: '3.6'
conda:
REPO_TYPE: 'conda'
python_version: '3.6'
pipfile:
REPO_TYPE: 'pipfile'
python_version: '3.6'
venv:
REPO_TYPE: 'venv'
python_version: '3.6'
stencila_py:
REPO_TYPE: 'stencila-py'
python_version: '3.6'
julia:
REPO_TYPE: 'julia'
python_version: '3.6'
r:
REPO_TYPE: 'r'
python_version: '3.6'
nix:
REPO_TYPE: 'nix'
python_version: '3.6'
dockerfile:
REPO_TYPE: 'dockerfile'
python_version: '3.6'
external:
REPO_TYPE: 'external'
python_version: '3.6'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python_version)
- script: |
git config --global user.email "ci@fake.tld"
git config --global user.name "CI Services"
displayName: 'Set up git'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install -r dev-requirements.txt
displayName: 'Install dev requirements'
- script: pip install -e .
displayName: 'Install repo2docker'
- script: pushd tests && pytest --durations 10 --cov repo2docker -v $(REPO_TYPE) && popd
displayName: 'Run tests $(REPO_TYPE)'
- script: |
# point to auto-lint-fix
if [[ "$REPO_TYPE" == "lint" ]]; then
echo "You can install pre-commit hooks to automatically run formatting"
echo "on each commit with:"
echo " pre-commit install"
echo "or you can run by hand on staged files with"
echo " pre-commit run"
echo "or after-the-fact on already committed files with"
echo " pre-commit run --all-files"
fi
displayName: 'Help to debug linter errors'
condition: failed()