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

MAINT: Migrate to github actions #1009

Merged
merged 11 commits into from
Jul 10, 2023
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
37 changes: 37 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will publish a new version of the documentation to the gh-pages branch

name: Publish Documentation

on:
push:
branches: [ "master" ]

jobs:
deploy:
if: ${{ github.repository == 'slaclab/pydm' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
mamba-version: "*"
channels: conda-forge
activate-environment: pydm-docs

- name: Install python packages
shell: bash -el {0}
run: |
mamba install pydm $(cat docs-requirements.txt)
- name: Build Docs
shell: bash -l {0}
run: |
pushd docs
make html
popd

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
52 changes: 52 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will run when a new release is published and upload it to PyPI using trusted publishing.
# Done in two separate build and publish jobs per suggested best practice for limiting token usage.

name: Publish - PyPI

on:
release:
types:
- published

jobs:
build:
name: Build new release
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build Package
run: python setup.py sdist

- name: Upload package
uses: actions/upload-artifact@v3
with:
name: package
path: dist/*
retention-days: 1

publish:
name: Publish release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # Used for trusted publishing
steps:
- name: Download package
uses: actions/download-artifact@v3
with:
name: package
path: dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
67 changes: 67 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow will install pydm dependencies, lint with flake8, and run the test suite, for all combinations
# of operating systems and version numbers specified in the matrix

name: Build Status

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
pyqt-version: [5.12.3, 5.15.7]
env:
DISPLAY: ':99.0'
QT_MAC_WANTS_LAYER: 1 # PyQT gui tests involving qtbot interaction on macOS will fail without this

steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
activate-environment: pydm-env
- name: Install python packages
shell: bash -el {0}
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
mamba install flake8 pyqt=${{ matrix.pyqt-version }}
mamba install --file requirements.txt
mamba install --file windows-dev-requirements.txt
else
mamba install flake8 pyqt=${{ matrix.pyqt-version }} $(cat requirements.txt dev-requirements.txt)
fi
- name: Install packages for testing a pyqt app on linux
shell: bash -el {0}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install xvfb herbstluftwm libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
sleep 3
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_herbstluftwm_99.pid --make-pidfile --background --exec /usr/bin/herbstluftwm
sleep 1
fi
- name: Lint with flake8
shell: bash -el {0}
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-line-length=120 --statistics
- name: Test with pytest
shell: bash -el {0}
run: |
python run_tests.py
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build Status](https://dev.azure.com/pydm/pydm/_apis/build/status/slaclab.pydm?branchName=master)](https://dev.azure.com/pydm/pydm/_build/latest?definitionId=1&branchName=master)
[![codecov](https://codecov.io/gh/slaclab/pydm/branch/master/graph/badge.svg)](https://codecov.io/gh/slaclab/pydm)
[![Build Status](https://github.com/slaclab/pydm/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/slaclab/pydm/actions/workflows/run-tests.yml)

<p align="center">
<h1 align="center">PyDM: Python Display Manager</h1>
Expand Down Expand Up @@ -31,7 +30,7 @@ as the abstraction layer for the Qt Python wrappers (PyQt5/PyQt4/PySide2/PySide)
**All tests are performed with PyQt5**.

# Prerequisites
* Python 3.6+
* Python 3.7+
* Qt 5.6 or higher
* qtpy
* PyQt5 >= 5.7 or any other Qt Python wrapper.
Expand Down
79 changes: 0 additions & 79 deletions azure-build-template.yml

This file was deleted.

23 changes: 0 additions & 23 deletions azure-pipelines-linux.yml

This file was deleted.

20 changes: 0 additions & 20 deletions azure-pipelines-macos.yml

This file was deleted.

26 changes: 0 additions & 26 deletions azure-pipelines-windows.yml

This file was deleted.

Loading