Skip to content

Do not open token temporary file in binary mode #84

Do not open token temporary file in binary mode

Do not open token temporary file in binary mode #84

Workflow file for this run

---
name: Run CI
on:
push:
branches:
- '**' # matches every branch
- '!gh-pages' # excludes gh-pages branch
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.6'
- '3.9'
name: Python ${{ matrix.python-version }} unit tests
steps:
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Note Python version/implementation/cache
run: |
which python3
python3 -c 'import sys; print(sys.version)'
python3 -c 'import platform; print(platform.python_implementation())'
python3 -m pip cache dir
- name: checkout DE Modules
uses: actions/checkout@v2
with:
path: decisionengine_modules
fetch-depth: 0
- name: checkout DE Framework
uses: actions/checkout@v2
with:
path: decisionengine
repository: HEPCloud/decisionengine
fetch-depth: 0
- name: checkout GlideinWMS for python3
uses: actions/checkout@v2
with:
path: glideinwms
repository: glideinWMS/glideinwms
ref: branch_v3_9
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('decisionengine_modules/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Fixup PATH for python libs
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies for GlideinWMS
run: |
set -x
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip install -r ${{ github.workspace }}/glideinwms/requirements.txt
- name: Install dependencies for DE Framework
run: |
set -x
cd ${{ github.workspace }}/decisionengine
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade pytest
python3 -m pip install --user Cython
python3 setup.py bdist_wheel
python3 -m pip install --user dist/decisionengine*.whl
- name: Install DE Modules dependencies (runtime)
run: |
set -x
cd ${{ github.workspace }}/decisionengine_modules
python3 -m pip install --upgrade pip
python3 -m pip install -e . --user
python3 -m pip list --user
- name: Install dependencies (unit tests)
run: |
set -x
cd ${{ github.workspace }}/decisionengine_modules
python3 -m pip install --upgrade pytest
python3 -m pip install -e .[develop] --user
python3 -m pip list --user
- name: Note DE Framework used in testing
run: |
set -x
python3 -c 'from decisionengine.framework import __version__; print("testing with framework", __version__)'
python3 -c 'import decisionengine.framework; print(decisionengine.framework.__file__)'
- name: Run Unit Tests on Python ${{ matrix.python-version }}
env:
PYTHONPATH: ${{ github.workspace }}/../:${{ github.workspace }}
run: |
cd ${{ github.workspace }}/decisionengine_modules
pytest --cov-report term --cov-report xml --cov=decisionengine_modules --no-cov-on-fail
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: python-${{ matrix.python-version }}
build_doc:
name: Generate Documentation
runs-on: ubuntu-latest
needs: test
steps:
- name: checkout code tree
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Note Python version/implementation/cache
run: |
which python3
python3 -c 'import sys; print(sys.version)'
python3 -c 'import platform; print(platform.python_implementation())'
python3 -m pip cache dir
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip python3-psycopg2 latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
python3 -m pip install --upgrade pip
python3 -m pip install -e .[develop] --user
python3 -m pip list --user
python3 -m pip install sphinx
- name: Build documentation
env:
PYTHONPATH: ${{ github.workspace }}/../:${{ github.workspace }}
run: |
cd doc
make rst html latexpdf
run_flake8:
name: Run pytest-flake8 against code tree
runs-on: ubuntu-latest
needs: test
steps:
- name: checkout DE Modules
uses: actions/checkout@v2
with:
path: decisionengine_modules
- name: checkout DE Framework
uses: actions/checkout@v2
with:
path: decisionengine
repository: HEPCloud/decisionengine
- name: checkout GlideinWMS for python3
uses: actions/checkout@v2
with:
path: glideinwms
repository: glideinWMS/glideinwms
ref: branch_v3_9
- uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Note Python version/implementation
run: |
which python3
python3 -c 'import sys; print(sys.version)'
python3 -c 'import platform; print(platform.python_implementation())'
python3 -m pip cache dir
- name: Install dependencies for GlideinWMS
run: |
set -x
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip install -r ${{ github.workspace }}/glideinwms/requirements.txt
- name: Install dependencies for DE Framework
run: |
set -x
cd ${{ github.workspace }}/decisionengine
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade pytest
python3 -m pip install --user Cython
python3 -m pip install --user numpy
python3 setup.py bdist_wheel
python3 -m pip install --user dist/decisionengine*.whl
- name: Install DE Modules dependencies
run: |
set -x
cd ${{ github.workspace }}/decisionengine_modules
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pytest
python3 -m pip install -e .[develop] --user
python3 -m pip list --user
- name: Run Flake8 checks
env:
PYTHONPATH: ${{ github.workspace }}/../:${{ github.workspace }}
run: |
cd ${{ github.workspace }}/decisionengine_modules
pytest -m flake8 --flake8