Skip to content

Commit

Permalink
Fix and clean CI configuration (#183)
Browse files Browse the repository at this point in the history
* remove travis configuration

* fix tox minimal

* fix ubuntu dependecies install

* remove codecov from minimal req

* add assert to test_exception_pass test

* add prerelase check

* add download data step

* change run branch on develop

* fix if to check runner os instead of matrix.os

* remove travis specific things

* try if specyfic environ for azure pipelines work

* another try of reference to deps

* remove obsolete tox config file (azure specific)

* tight prerelease check

* correct numpy deprecation

* clean float part two

* fix deepsource warnings

* add tox-gh-actions install
  • Loading branch information
Czaki authored Feb 2, 2021
1 parent 79222a1 commit cd381a7
Show file tree
Hide file tree
Showing 30 changed files with 260 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
path: $(Build.SourcesDirectory)/test_data
- script: pip install -r requirements/requirements_dev.txt
displayName: "Install deps"
- script: tox -c tox-azure.ini -e py38-PyQt5
- script: tox -e py38-PyQt5-azure
displayName: "Run Tox"
env:
CODECOV_TOKEN: $(codecov_token_secret)
12 changes: 12 additions & 0 deletions .github/TEST_FAIL_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "{{ env.TITLE }}"
labels: [bug]
---
The {{ workflow }} workflow failed on {{ date | date("YYYY-MM-DD HH:mm") }} UTC

The most recent failing test was on {{ env.PLATFORM }} py{{ env.PYTHON }}
with commit: {{ sha }}

Full run: https://github.com/{{ payload.repository.full_name }}/actions/runs/{{ env.RUN_ID }}

(This post will be updated if another test fails, as long as this issue remains open.)
13 changes: 11 additions & 2 deletions .github/actions/run-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ runs:
python-version: ${{ matrix.python_version }}

- name: Install ubuntu libraries
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 \
libxcb-xinput0 libxcb-xfixes0
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
- name: Download test data
uses: actions/download-artifact@v1
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/test_prereleases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# An "early warning" cron job that will install dependencies
# with `pip install --pre` periodically to test for breakage
# (and open an issue if a test fails)
name: --pre Test

on:
push:
branches:
- master
- develop
schedule:
- cron: '0 */12 * * *' # every 12 hours
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
download_data:
name: Download test data
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- shell: bash
run: bash build_utils/download_data.sh
- name: Upload test data
uses: actions/upload-artifact@v1
with:
name: test_data
path: test_data


test:
name: ${{ matrix.platform }} py${{ matrix.python }} ${{ matrix.backend }} --pre
runs-on: ${{ matrix.platform }}
needs: download_data
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python: [3.8]

steps:
- uses: actions/checkout@v2

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

- name: Install Linux libraries
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \
libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
- name: Download test data
uses: actions/download-artifact@v1
with:
name: test_data

- name: Install dependencies
run: |
pip install --upgrade pip
pip install setuptools tox tox-gh-actions
- name: Test with tox
# run tests using pip install --pre
run: tox -v --pre
env:
PLATFORM: ${{ matrix.platform }}
PYVISTA_OFF_SCREEN: True # required for opengl on windows

# If something goes wrong, we can open an issue in the repo
- name: Report Failures
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python }}
RUN_ID: ${{ github.run_id }}
TITLE: '[test-bot] pip install --pre is failing'
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true
67 changes: 56 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- shell: bash
run: bash .travis/install2.sh
run: bash build_utils/download_data.sh
- name: Upload test data
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -50,7 +50,16 @@ jobs:

- name: Install ubuntu libraries
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 \
libxcb-xinput0 libxcb-xfixes0
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
- name: Download test data
uses: actions/download-artifact@v1
Expand All @@ -61,9 +70,9 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -r requirements/requirements_dev.txt
python -m pip install -r requirements/requirements_dev.txt tox-gh-actions
- name: Test PartSeg
run: tox -e ${{ matrix.toxenv }}
run: tox


test_feature:
Expand All @@ -83,8 +92,17 @@ jobs:
python-version: '3.7'

- name: Install ubuntu libraries
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 \
libxcb-xinput0 libxcb-xfixes0
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
- name: Download test data
uses: actions/download-artifact@v1
Expand All @@ -95,7 +113,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -r requirements/requirements_dev.txt
python -m pip install -r requirements/requirements_dev.txt tox-gh-actions
- name: Test PartSeg
run: tox -e 'py37-PyQt5,py37-PySide2'

Expand All @@ -110,10 +128,6 @@ jobs:
with:
python-version: '3.7'

- name: Install ubuntu libraries
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0

- name: Download test data
uses: actions/download-artifact@v1
with:
Expand All @@ -130,3 +144,34 @@ jobs:
with:
file: ./coverage.xml
fail_ci_if_error: true


test_minimal:
name: Test PartSeg minimal
runs-on: ubuntu-latest
needs: download_data
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
name: Install Python '3.6'
with:
python-version: '3.6'

- name: Install ubuntu libraries
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 \
libxcb-xinput0 libxcb-xfixes0
- name: Download test data
uses: actions/download-artifact@v1
with:
name: test_data
- name: create minimal req
run: python build_utils/create_minimal_req.py

- name: Install dependencies
run: |
python -m pip install -r requirements/requirements_dev.txt
- name: Test PartSeg
run: tox -e 'py36-PyQt5-minimal'
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ repos:
rev: v0.11.0 # Use the ref you want to point at
hooks:
- id: markdownlint
exclude: vendored|__init__.py|examples|TEST_FAIL_TEMPLATE.md
4 changes: 0 additions & 4 deletions .requires.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ requirements:
- docs/requirements.txt
- setup.py
- tox.ini
- path: tox-azure.ini
parser: python/tox
- path: tox-minimal.ini
parser: python/tox
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .travis/install.sh

This file was deleted.

1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# PartSeg

[![Travis Build Status](https://travis-ci.com/4DNucleome/PartSeg.svg?branch=master)](https://travis-ci.com/4DNucleome/PartSeg)
![Tests](https://github.com/4DNucleome/PartSeg/workflows/Tests/badge.svg?branch=master)
[![PyPI version](https://badge.fury.io/py/PartSeg.svg)](https://badge.fury.io/py/PartSeg)
[![Documentation Status](https://readthedocs.org/projects/partseg/badge/?version=latest)](https://partseg.readthedocs.io/en/latest/?badge=latest)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stages:
- job: linux
pool: {vmImage: 'Ubuntu-16.04'}
steps:
- script: bash .travis/install2.sh
- script: bash build_utils/download_data.sh
displayName: "download data"
- task: UsePythonVersion@0
inputs:
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions .travis/minimal-req.txt → build_utils/minimal-req.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Cython==0.29.13
PartSegData==0.9.4
PartSegCore_compiled_backend==0.12.0a0
PartSegData==0.10.0
PyOpenGL-accelerate==3.1.5
QtPy==1.7.0
SimpleITK==1.1.0
Expand All @@ -17,13 +17,13 @@ openpyxl==2.4.9
packaging==17.1
pandas==0.22.0
requests==2.18.0
scipy==0.19.1
scipy==1.2.0
sentry_sdk==0.14.3
six==1.11.0
sympy==1.1.1
tifffile==2019.7.26
tifffile==2020.2.16
xlrd==1.1.0
xlsxwriter
dataclasses==0.7 ;python_version < '3.7'
typing-extensions==3.7 ;python_version < '3.8'
PyQt5==5.12.3
typing-extensions==3.7.4 ;python_version < '3.8'
PyQt5!=5.15.0,==5.12.3
Loading

0 comments on commit cd381a7

Please sign in to comment.