Skip to content

Commit

Permalink
Add github CI (#432)
Browse files Browse the repository at this point in the history
Co-authored-by: Bohdan Vanieiev <[email protected]>
  • Loading branch information
Warchant and Bohdan Vanieiev authored Oct 10, 2023
1 parent 06f54ed commit 2a8e94e
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 46 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest
# see /dev.Dockerfile
container: warchantua/py-toml-dev:v1
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: get toml-test
run: |
git clone https://github.com/BurntSushi/toml-test
# cd toml-test/cmd/toml-test
# go build
- name: Run python tests
run: |
pip -q install "tox>=4"
tox run-parallel --parallel-no-spinner
# TODO(warchant): this cmd is old, need to update it
# - name: Run go tests
# run: |
# pip -q install setuptools
# python setup.py install
# ./toml-test/cmd/toml-test/toml-test -i ./tests -g ./tests/gotests.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ tramp

# vscode
.vscode


toml-test
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


FROM ubuntu:22.04

ENV PYENV_ROOT="/opt/.pyenv" \
PATH="/opt/pipx/bin:/opt/.pyenv/shims:/opt/.pyenv/bin:$PATH" \
PIPX_HOME="/opt/pipx" \
PIPX_BIN_DIR="/opt/pipx/bin"

RUN mkdir $PIPX_HOME \
&& apt-get update \
&& apt-get install -y ccache build-essential git curl libssl-dev libz-dev libbz2-dev libncurses-dev libffi-dev libsqlite3-dev liblzma-dev libreadline-dev \
&& curl https://pyenv.run | bash \
&& git clone https://github.com/pyenv/pyenv-ccache.git $(pyenv root)/plugins/pyenv-ccache \
# NOTE: 3.3 installation fails with a segmentation fault :(
# NOTE: 3.4 installation fails: cannot find libssl (while it is installed)
&& pyenv install 2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 \
# enable all versions, 3.12 is default
&& pyenv global 3.12 2.7 3.5 3.6 3.7 3.8 3.9 3.10 3.11 \
&& pip install pipx \
&& pipx install tox>=4 \
&& pipx install poetry \
&& pipx install pre-commit \
&& ccache -C \
&& rm -rf /var/lib/apt/lists/*
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
packages=['toml'],
license="MIT",
long_description=readme_string,
setup_requires=['setuptools'],
python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*",
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -36,6 +37,9 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
]
Expand Down
4 changes: 0 additions & 4 deletions tests/decoding_test.sh

This file was deleted.

4 changes: 0 additions & 4 deletions tests/decoding_test2.sh

This file was deleted.

4 changes: 0 additions & 4 deletions tests/decoding_test3.sh

This file was deleted.

35 changes: 34 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[tox]
envlist = py27, py33, py34, py35, py36, py37, py38, py39, pypy
min_version = 4.0
# run this to setup all required interpreters:
# pyenv global 3.12 3.11 3.10 3.9 3.8 3.7 3.6 3.5 2.7
envlist = py27, py3{5,6,7,8,9,10,11,12}
skip_missing_interpreters = True

[testenv]
deps =
Expand All @@ -22,3 +26,32 @@ deps =
commands =
pytest tests --cov=./toml
codecov



[testenv:py27]
base_python = python2.7

[testenv:py35]
base_python = python3.5

[testenv:py36]
base_python = python3.6

[testenv:py37]
base_python = python3.7

[testenv:py38]
base_python = python3.8

[testenv:py39]
base_python = python3.9

[testenv:py310]
base_python = python3.10

[testenv:py311]
base_python = python3.11

[testenv:py312]
base_python = python3.12

0 comments on commit 2a8e94e

Please sign in to comment.