Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Travis CI with GitHub Actions #327

Merged
merged 2 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: main

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -

- name: Check dependencies
run: make doctor

- uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
run: make install

- name: Test code
run: make test-repeat

- name: Upload coverage
uses: codecov/[email protected]
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Check code
run: make check

- name: Check documentation
run: make mkdocs notebooks
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test: install ## Run unit and integration tests

.PHONY: test-repeat
test-repeat: install
poetry run pytest --count=5 --random --exitfirst
poetry run pytest --count=5 --random --exitfirst --cov-report=xml

.PHONY: test-profile
test-profile: install
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jinja2==3.1.3 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0"
markdown==3.3.4 ; python_version >= "3.8" and python_version < "4.0"
mkdocs==1.4.2 ; python_version >= "3.8" and python_version < "4.0"
jupyterlab-pygments==0.2.2 ; python_version >= "3.8" and python_version < "4.0" and sys_platform != "win32"
jupyterlab-pygments==0.2.2 ; python_version >= "3.8" and python_version < "4.0" and os_name != "nt"
pygments==2.15.0 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==4.12.0 ; python_version >= "3.8" and python_version < "3.10"
192 changes: 41 additions & 151 deletions notebooks/file_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "8845a361",
"id": "e3794ade",
"metadata": {
"tags": []
},
Expand All @@ -13,7 +13,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "07e88e6d",
"id": "e8ee27c3",
"metadata": {
"tags": []
},
Expand All @@ -40,7 +40,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7c897e1a",
"id": "418fe5d8",
"metadata": {
"tags": []
},
Expand All @@ -67,7 +67,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "63bb2409",
"id": "17241aab",
"metadata": {
"tags": []
},
Expand All @@ -79,7 +79,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9429b844",
"id": "3c493823",
"metadata": {
"tags": []
},
Expand All @@ -88,172 +88,62 @@
"name": "stdout",
"output_type": "stream",
"text": [
"names:\n",
" - Alice\n",
" - Bob\n",
"numbers:\n",
" - 1\n",
" - 2\n",
" - 3\n"
"names:\n"
]
}
],
"source": [
"%%sh\n",
"\n",
"cat files/sample.yml"
]
},
{
"cell_type": "markdown",
"id": "a6b718bd",
"metadata": {
"tags": []
},
"source": [
"# Complex"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "14646062",
"metadata": {
"tags": []
},
"outputs": [
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"dist: focal\n",
"\n",
"language: python\n",
"python:\n",
" - \"3.8\"\n",
" - \"3.9\"\n",
" - \"3.10\"\n",
" - \"3.11\"\n",
"\n",
"cache:\n",
" pip: true\n",
" directories:\n",
" - ${VIRTUAL_ENV}\n",
"\n",
"before_install:\n",
" - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -\n",
" - make doctor\n",
"\n",
"install:\n",
" - make install\n",
"\n",
"script:\n",
" - make test-repeat\n",
" - make check\n",
" # TODO: Get targets working with Python 3.10\n",
" # - make notebooks\n",
" # - make mkdocs\n",
"\n",
"after_success:\n",
" - pip install coveralls\n",
" - coveralls\n",
"\n",
"notifications:\n",
" email:\n",
" on_success: never\n",
" on_failure: never\n"
" - Alice\n"
]
}
],
"source": [
"%%sh\n",
"\n",
"cp -f ../.travis.yml files/travis.yml\n",
"\n",
"cat files/travis.yml"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9361e912",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from datafiles import auto\n",
"\n",
"travis = auto(\"files/travis.yml\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6c437564",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"travis.install.append(\"echo 123 # <= This line is new\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "edb647e0",
"metadata": {
"tags": []
},
"outputs": [
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"dist: focal\n",
"\n",
"language: python\n",
"python:\n",
" - '3.8'\n",
" - '3.9'\n",
" - '3.10'\n",
" - '3.11'\n",
"cache:\n",
" pip: true\n",
" directories:\n",
" - ${VIRTUAL_ENV}\n",
"\n",
"before_install:\n",
" - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py\n",
" | python -\n",
" - make doctor\n",
"install:\n",
" - make install\n",
" - 'echo 123 # <= This line is new'\n",
"script:\n",
" - make test-repeat\n",
" - make check\n",
"after_success:\n",
" - pip install coveralls\n",
" - coveralls\n",
"notifications:\n",
" email:\n",
" on_success: never\n",
" on_failure: never\n"
" - Bob\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"numbers:\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" - 1\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" - 2\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" - 3\n"
]
}
],
"source": [
"%%sh\n",
"\n",
"cat files/travis.yml"
"cat files/sample.yml"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -267,7 +157,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
Loading
Loading