Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ci(compatibility): test on more Python versions and on macOS (#131)
BREAKING CHANGE: on Ubuntu 20.04+, the `texlive-latex-extra` package is needed to generate the PDF output
  • Loading branch information
Deuchnord authored and Jérôme Deuchnord committed Jan 22, 2021
1 parent c619a77 commit 0b12e71
Show file tree
Hide file tree
Showing 21 changed files with 358 additions and 272 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Expand Up @@ -3,4 +3,5 @@ branch = true
source =
kosmorrolib
omit =
kosmorrolib/main.py
test/*
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -12,5 +12,8 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
15 changes: 9 additions & 6 deletions .github/workflows/commitlint.yml
@@ -1,24 +1,27 @@
name: Commit lint

on: [push, pull_request]
on:
push:
branches: [master, features]
pull_request:
branches: [master, features]

jobs:
build:
commitlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip pipenv
pipenv sync -d
pip install --upgrade pip comlipy
- name: Lint
run: |
message="$(git log --format=%B -n 1 HEAD)"
echo $message
pipenv run comlipy -c config-comlipy.yml "$message"
comlipy -c config-comlipy.yml "$message"
25 changes: 20 additions & 5 deletions .github/workflows/e2e.yml
@@ -1,18 +1,33 @@
name: E2E tests

on: [push, pull_request]
on:
push:
branches: [master, features]
pull_request:
branches: [master, features]

jobs:
build:
runs-on: ubuntu-latest

e2e-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
python-version:
- '3.7'
- '3.8'
- '3.9'

name: E2E tests (Python ${{ matrix.python-version }} on ${{ matrix.os }})
steps:
- uses: actions/checkout@v1

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

- name: Prepare tests
run: |
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/i18n.yml
@@ -1,9 +1,13 @@
name: Internationalization check

on: [push, pull_request]
on:
push:
branches: [master, features]
pull_request:
branches: [master, features]

jobs:
build:
internationalization:
runs-on: ubuntu-latest

steps:
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/pylint.yml
@@ -1,17 +1,22 @@
name: PyLint
name: Python Lint

on: [push, pull_request]
on:
push:
branches: [master, features]
pull_request:
branches: [master, features]

jobs:
build:
pylint:
runs-on: ubuntu-latest

name: PyLint
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip pipenv
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/unit-tests.yml
@@ -1,17 +1,34 @@
name: Unit tests

on: [push, pull_request]
on:
push:
branches: [master, features]
pull_request:
branches: [master, features]

jobs:
build:
runs-on: ubuntu-latest
unit-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- macos-10.15
- macos-11.0
python-version:
- '3.7'
- '3.8'
- '3.9'

name: Unit tests (Python ${{ matrix.python-version }} on ${{ matrix.os }})
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip pipenv
Expand Down
4 changes: 3 additions & 1 deletion .pylintrc
Expand Up @@ -147,7 +147,9 @@ disable=print-statement,
too-few-public-methods,
protected-access,
unnecessary-comprehension,
too-many-arguments
too-many-arguments,
unsubscriptable-object,
too-many-return-statements

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
3 changes: 1 addition & 2 deletions .scripts/tests-e2e.sh
Expand Up @@ -101,8 +101,7 @@ assertSuccess "LATITUDE=50.5876 LONGITUDE=3.0624 TIMEZONE=-1 kosmorro -d 2020-01
# Missing dependencies, should fail
assertFailure "kosmorro --latitude=50.5876 --longitude=3.0624 -d 2020-01-27 --format=pdf -o /tmp/document.pdf"

assertSuccess "sudo apt-get install -y texlive" "CI"
assertSuccess "$PIP_BIN install latex" "CI"
assertSuccess "sudo apt-get install -y texlive texlive-latex-extra" "CI"

# Dependencies installed, should not fail
assertSuccess "kosmorro --latitude=50.5876 --longitude=3.0624 -d 2020-01-27 --format=pdf -o /tmp/document.pdf"
Expand Down
2 changes: 2 additions & 0 deletions Makefile
@@ -1,6 +1,8 @@
.PHONY: test

test:
export LC_ALL=C.UTF-8; \
export LANG=C.UTF-8; \
unset KOSMORRO_LATITUDE; \
unset KOSMORRO_LONGITUDE; \
unset KOSMORRO_TIMEZONE; \
Expand Down
2 changes: 0 additions & 2 deletions Pipfile
Expand Up @@ -9,14 +9,12 @@ pylint = "*"
babel = "*"
unittest-data-provider = "*"
coveralls = "*"
comlipy = "*"

[packages]
skyfield = ">=1.32.0,<2.0.0"
tabulate = "*"
numpy = ">=1.17.0,<2.0.0"
termcolor = "*"
latex = "*"
python-dateutil = "*"

[requires]
Expand Down

0 comments on commit 0b12e71

Please sign in to comment.