kopia lustrzana https://github.com/jupyterhub/repo2docker
Merge pull request #1186 from consideRatio/pr/ci-refresh
ci: general refresh of github workflows, update gha versions and let dependabot do it, etc.pull/1191/head
commit
c981b3baa7
|
@ -0,0 +1,16 @@
|
|||
# dependabot.yml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
#
|
||||
# Notes:
|
||||
# - Status and logs from dependabot are provided at
|
||||
# https://github.com/jupyterhub/repo2docker/network/updates.
|
||||
# - YAML anchors are not supported here or in GitHub Workflows.
|
||||
#
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies in our GitHub Workflows
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/" # This should be / rather than .github/workflows
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: "05:00"
|
||||
timezone: "Etc/UTC"
|
|
@ -1,21 +1,42 @@
|
|||
# This is a GitHub workflow defining a set of jobs with a set of steps.
|
||||
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||
#
|
||||
name: Docker build
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**.md"
|
||||
- "**.rst"
|
||||
- ".github/workflows/*"
|
||||
- "!.github/workflows/docker.yml"
|
||||
push:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**.md"
|
||||
- "**.rst"
|
||||
- ".github/workflows/*"
|
||||
- "!.github/workflows/docker.yml"
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
- "pre-commit-ci-update-config"
|
||||
tags:
|
||||
- "**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
tags: jupyter/repo2docker:pr
|
||||
|
|
|
@ -1,27 +1,45 @@
|
|||
# This is a GitHub workflow defining a set of jobs with a set of steps.
|
||||
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||
#
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**.md"
|
||||
- "**.rst"
|
||||
- ".github/workflows/*"
|
||||
- "!.github/workflows/release.yml"
|
||||
push:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**.md"
|
||||
- "**.rst"
|
||||
- ".github/workflows/*"
|
||||
- "!.github/workflows/release.yml"
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
- "pre-commit-ci-update-config"
|
||||
tags:
|
||||
- "**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-n-publish:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: "Setup Python 3.8"
|
||||
uses: actions/setup-python@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
python-version: "3.9"
|
||||
|
||||
- name: "Install dependencies"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade -r dev-requirements.txt
|
||||
pip install -r dev-requirements.txt
|
||||
pip freeze
|
||||
|
||||
- name: "Build distribution archives"
|
||||
- name: Build distribution archives
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
|
||||
|
@ -29,12 +47,12 @@ jobs:
|
|||
# all previous steps always run in order to exercise them
|
||||
- name: Publish distribution to PyPI
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
uses: pypa/gh-action-pypi-publish@v1.5.1
|
||||
with:
|
||||
password: ${{ secrets.PYPI_PASSWORD }}
|
||||
|
||||
publish-docker:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
DEFAULT_REGISTRY: quay.io
|
||||
IMAGE_NAME: jupyterhub/repo2docker
|
||||
|
@ -58,19 +76,18 @@ jobs:
|
|||
echo "Publishing to $REGISTRY"
|
||||
|
||||
# versioneer requires the full git history for non-tags
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Setup docker to build for multiple platforms, see:
|
||||
# https://github.com/docker/build-push-action/tree/v2.4.0#usage
|
||||
# https://github.com/docker/build-push-action/blob/v2.4.0/docs/advanced/multi-platform.md
|
||||
|
||||
- name: Set up QEMU (for docker buildx)
|
||||
uses: docker/setup-qemu-action@25f0500ff22e406f7191a2a8ba8cda16901ca018
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx (for multi-arch builds)
|
||||
uses: docker/setup-buildx-action@2a4b53665e15ce7d7049afb11ff1f70ff1610609
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
# Allows pushing to registry on localhost:5000
|
||||
driver-opts: network=host
|
||||
|
@ -97,7 +114,7 @@ jobs:
|
|||
echo "TAGS=$TAGS" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push repo2docker
|
||||
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
|
|
|
@ -1,19 +1,35 @@
|
|||
# Useful GitHub Actions docs:
|
||||
# This is a GitHub workflow defining a set of jobs with a set of steps.
|
||||
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||
#
|
||||
# - 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
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**.md"
|
||||
- "**.rst"
|
||||
- ".github/workflows/*"
|
||||
- "!.github/workflows/test.yml"
|
||||
push:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
- "**.md"
|
||||
- "**.rst"
|
||||
- ".github/workflows/*"
|
||||
- "!.github/workflows/test.yml"
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
- "pre-commit-ci-update-config"
|
||||
tags:
|
||||
- "**"
|
||||
schedule:
|
||||
# Weekly test so we know if tests break for external reasons
|
||||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events
|
||||
# Run weekly test so we know if tests break for external reasons
|
||||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#scheduled-events
|
||||
#
|
||||
# At 10:36 on Sunday (https://crontab.guru)
|
||||
- cron: '36 10 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
# Global environment variables
|
||||
env:
|
||||
|
@ -23,51 +39,45 @@ env:
|
|||
GIT_AUTHOR_NAME: CI User
|
||||
|
||||
jobs:
|
||||
# Job to run linter / autoformat
|
||||
lint:
|
||||
runs-on: ubuntu-20.04
|
||||
pre-commit:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python_version: ["3.9"]
|
||||
|
||||
steps:
|
||||
# Action Repo: https://github.com/actions/checkout
|
||||
- name: "Checkout repo"
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
python-version: "${{ matrix.python_version }}"
|
||||
|
||||
# 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
|
||||
# There will almost never be a cache hit on the cache key when this job is
|
||||
# run, as it is the first of all jobs in this workflow. The subsequent
|
||||
# jobs in this workflow can rely on this cache though.
|
||||
- name: Save pip's install cache on job completion
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
key: "${{ github.run_id }}-${{ matrix.python_version }}"
|
||||
|
||||
- name: "Install dependencies"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip
|
||||
pip install --upgrade -r dev-requirements.txt
|
||||
pip install -r dev-requirements.txt
|
||||
pip freeze
|
||||
|
||||
- name: "Run linter"
|
||||
run: |
|
||||
pre-commit run --all-files
|
||||
- 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-20.04
|
||||
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy
|
||||
needs: pre-commit
|
||||
runs-on: ubuntu-${{ matrix.ubuntu_version }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false # Do not cancel all jobs if one fails
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python_version: ["3.8"]
|
||||
ubuntu_version: ["22.04"]
|
||||
python_version: ["3.9"]
|
||||
repo_type:
|
||||
- base
|
||||
- conda
|
||||
|
@ -80,44 +90,44 @@ jobs:
|
|||
- unit
|
||||
- venv
|
||||
include:
|
||||
- python_version: "3.6"
|
||||
# The actions/setup-python action with Python version 3.6 isn't
|
||||
# possible to use with the ubuntu-22.04 runner, so we use ubuntu-20.04
|
||||
# for this test where Python 3.6 remain available.
|
||||
- ubuntu_version: "20.04"
|
||||
python_version: "3.6"
|
||||
repo_type: venv
|
||||
|
||||
steps:
|
||||
- name: "Checkout repo"
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: "Setup Python"
|
||||
uses: actions/setup-python@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
python-version: "${{ matrix.python_version }}"
|
||||
|
||||
# Action Repo: https://github.com/actions/cache
|
||||
- name: "Cache pip dependencies"
|
||||
uses: actions/cache@v2
|
||||
- name: Restore pip's install cache from previous job
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
key: "${{ github.run_id }}-${{ matrix.python_version }}"
|
||||
|
||||
- name: "Install"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools pip wheel
|
||||
pip install --upgrade -r dev-requirements.txt
|
||||
python setup.py bdist_wheel
|
||||
pip install dist/*.whl
|
||||
# add for mercurial tests
|
||||
pip install mercurial hg-evolve
|
||||
pip install -r dev-requirements.txt
|
||||
pip freeze
|
||||
|
||||
- name: "Run tests"
|
||||
- name: Install repo2docker
|
||||
run: |
|
||||
cd tests
|
||||
pytest --durations 10 --cov repo2docker -v ${{ matrix.repo_type }}
|
||||
python setup.py bdist_wheel
|
||||
pip install dist/*.whl
|
||||
|
||||
- name: "Upload code coverage stats"
|
||||
# add for mercurial tests
|
||||
pip install mercurial hg-evolve
|
||||
|
||||
pip freeze
|
||||
|
||||
- name: Run pytest
|
||||
run: |
|
||||
pip install codecov
|
||||
pushd tests && codecov && cat
|
||||
cat /home/runner/work/repo2docker/repo2docker/tests/coverage.xml
|
||||
pytest --verbose --color=yes --durations=10 --cov=repo2docker tests/${{ matrix.repo_type }}
|
||||
|
||||
- name: Submit codecov report
|
||||
run: |
|
||||
codecov
|
||||
|
|
|
@ -1,6 +1,44 @@
|
|||
# pre-commit is a tool to perform a predefined set of tasks manually and/or
|
||||
# automatically before git commits are made.
|
||||
#
|
||||
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
|
||||
#
|
||||
# Common tasks
|
||||
#
|
||||
# - Run on all files: pre-commit run --all-files
|
||||
# - Register git hooks: pre-commit install --install-hooks
|
||||
#
|
||||
repos:
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 22.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: [--target-version=py36]
|
||||
# # Autoformat: Python code, syntax patterns are modernized
|
||||
# - repo: https://github.com/asottile/pyupgrade
|
||||
# rev: v3.0.0
|
||||
# hooks:
|
||||
# - id: pyupgrade
|
||||
# args:
|
||||
# - --py38-plus
|
||||
|
||||
# Autoformat: Python code
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
args:
|
||||
- --target-version=py36
|
||||
- --target-version=py37
|
||||
- --target-version=py38
|
||||
- --target-version=py39
|
||||
- --target-version=py310
|
||||
|
||||
# # Autoformat: Python code
|
||||
# - repo: https://github.com/pycqa/isort
|
||||
# rev: 5.10.1
|
||||
# hooks:
|
||||
# - id: isort
|
||||
# args:
|
||||
# - --profile=black
|
||||
|
||||
# # Autoformat: markdown, yaml (but not helm templates)
|
||||
# - repo: https://github.com/pre-commit/mirrors-prettier
|
||||
# rev: v2.7.1
|
||||
# hooks:
|
||||
# - id: prettier
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# <a href="https://github.com/jupyterhub/repo2docker"><img src="https://raw.githubusercontent.com/jupyterhub/repo2docker/8731ecf0967cc5fde028c456f2b92be651ebbc18/docs/source/_static/images/repo2docker.png" height="48px" /> repo2docker</a>
|
||||
|
||||
[![Build Status](https://github.com/jupyterhub/repo2docker/workflows/Continuous%20Integration/badge.svg)](https://github.com/jupyterhub/repo2docker/actions)
|
||||
[![Build Status](https://github.com/jupyterhub/repo2docker/workflows/Test/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)
|
||||
[![Contribute](https://img.shields.io/badge/I_want_to_contribute!-grey?logo=jupyter)](https://repo2docker.readthedocs.io/en/latest/contributing/contributing.html)
|
||||
[![Docker Repository on Quay](https://img.shields.io/badge/quay.io-container-green "Docker Repository on Quay")](https://quay.io/repository/jupyterhub/repo2docker?tab=tags)
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
pyyaml
|
||||
pytest>=4.6
|
||||
wheel
|
||||
pytest-cov
|
||||
pre-commit
|
||||
requests_mock
|
||||
codecov
|
||||
conda-lock
|
||||
pre-commit
|
||||
pytest-cov
|
||||
pytest>=4.6
|
||||
pyyaml
|
||||
requests_mock
|
||||
wheel
|
||||
|
|
Ładowanie…
Reference in New Issue