Skip to content

Replaced dls-controls with epics-python #225

Replaced dls-controls with epics-python

Replaced dls-controls with epics-python #225

Workflow file for this run

name: Code CI
on:
push:
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# DLS RHEL7 legacy
- os: ubuntu-latest
python: "2.7"
publish: true
epics: "R3.14.12.7"
# sphinx deps don't work on 2.7, so install manually
pipenv: "--skip-lock && pipenv run pip install pytest-cov pytest-flake8"
# DLS RHEL7 python3 current
- os: ubuntu-latest
python: "3.7"
epics: "R3.14.12.7"
pipenv: "--dev --deploy"
# DLS RHEL7 python3 as used by pythonIoc
- os: ubuntu-latest
python: "3.7"
publish: true
pipenv: "--dev --deploy"
# Other random possibilities
- os: ubuntu-latest
python: "3.8"
epics: "R3.15.8"
pipenv: "--dev --deploy"
- os: ubuntu-latest
python: "3.9"
pipenv: "--dev --deploy"
- os: windows-latest
python: "3.7"
pipenv: "--dev --deploy"
name: ${{ matrix.os }}/${{ matrix.python }}/${{ matrix.epics }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install EPICS Base
if: matrix.epics
run: |
wget -nv https://github.com/epics-base/epics-base/archive/${{ matrix.epics }}.tar.gz
tar -zxf ${{ matrix.epics }}.tar.gz
make -sj -C epics-base-${{ matrix.epics }}
echo "EPICS_BASE=`pwd`/epics-base-${{ matrix.epics }}" >> $GITHUB_ENV
- name: Install Python Dependencies
# Pin pipenv so it works on python2.7
run: |
pip install pipenv==2020.6.2 twine build
pipenv install --python $(python -c 'import sys; print(sys.executable)') ${{ matrix.pipenv }} && pipenv graph
- name: Install epicscorelibs
if: ${{ ! matrix.epics }}
run: pipenv run pip install epicscorelibs
- name: Create Sdist and Wheel
if: matrix.publish
# Set SOURCE_DATE_EPOCH from git commit for reproducible build
# https://reproducible-builds.org/
# Set group writable and umask to do the same to match inside DLS
run: |
chmod -R g+w .
umask 0002
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) python -m build --sdist --wheel
- name: Run Tests
run: pipenv run tests
- name: Upload Wheel and Sdist
if: matrix.publish
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*
- name: Publish Sdist and Wheel to PyPI
# Only once when on a tag
if: ${{ matrix.publish && startsWith(github.ref, 'refs/tags') }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: twine upload dist/*
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: ${{ matrix.os }}/${{ matrix.python }}/${{ matrix.epics }}
files: cov.xml