Skip to content

Merge pull request #902 from CoffeaTeam/0.7-linting-fixes #3979

Merge pull request #902 from CoffeaTeam/0.7-linting-fixes

Merge pull request #902 from CoffeaTeam/0.7-linting-fixes #3979

Workflow file for this run

name: CI/CD
on:
push:
branches:
- master
- backports-v0.6.x
tags:
- v*.*.*
pull_request:
branches:
- master
- backports-v0.6.x
# Run daily at 0:01 UTC
schedule:
- cron: '1 0 * * *'
jobs:
linter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
name: linter - flake8/black - python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8 and black
run: |
python -m pip install -q flake8 black
flake8 coffea tests setup.py
black --check --diff coffea tests setup.py
test:
runs-on: ${{ matrix.os }}
needs: linter
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
java-version: [8]
java-distribution: ["corretto"]
python-version: ["3.7", "3.10"]
name: test coffea (${{ matrix.os }}) - python ${{ matrix.python-version }}, JDK${{ matrix.java-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up JDK ${{ matrix.java-version }}
if: matrix.os != 'windows-latest'
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.java-distribution }}
- name: Set python 3.6 test settings
run: |
echo "INSTALL_EXTRAS=[dev,parsl,dask,spark]" >> $GITHUB_ENV
if: matrix.python-version == 3.6
- name: Set python newer than 3.6 test settings
run: |
echo "INSTALL_EXTRAS=[dev,parsl,dask,spark,servicex]" >> $GITHUB_ENV
if: matrix.python-version != 3.6
- name: Install dependencies (Linux/MacOS)
if: matrix.os != 'windows-latest'
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -q -e .${{env.INSTALL_EXTRAS}}
python -m pip list
java -version
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -q -e .[dev]
python -m pip list
- name: Test with pytest
env:
ARROW_PRE_0_15_IPC_FORMAT: 1
run: |
pytest --cov-report=xml --cov=coffea tests
- name: Upload codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10
run: |
python -m pip install codecov
codecov
- name: Install graphviz
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10
uses: kamiazya/setup-graphviz@v1
- name: Install pandoc
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10
uses: r-lib/actions/setup-pandoc@v2
- name: Build documentation
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10
run: |
cd docs && make html
touch build/html/.nojekyll
- name: Deploy documentation
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: docs/build/html
env:
GH_PAT: ${{ secrets.GITHUB_OAUTH }}
testwq:
runs-on: ubuntu-latest
needs: linter
strategy:
matrix:
python-version: ["3.10"]
name: test coffea-workqueue
steps:
- uses: actions/checkout@v3
- name: Set up Conda
uses: conda-incubator/[email protected]
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Test work_queue
shell: bash -l {0}
run: |
conda create --yes --name coffea-env -c conda-forge python=${{ matrix.python-version }} ndcctools dill conda-pack conda
conda activate coffea-env
python -m pip install --ignore-installed .
cd tests
conda-pack --output coffea-env.tar.gz
python wq.py coffea-env.tar.gz
# testskyhookjob:
# runs-on: ubuntu-latest
# needs: linter
# name: test coffea-skyhook-job
#
# steps:
# - uses: actions/[email protected]
# - name: Test Coffea Skyhook Bindings
# shell: bash -l {0}
# run: |
# docker build -t coffea-skyhook-test \
# --file docker/skyhook/Dockerfile \
# .
# docker run \
# -v $(pwd):/w \
# -w /w \
# -e IS_CI=true \
# --privileged \
# coffea-skyhook-test \
# ./docker/skyhook/script.sh
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [test, testwq]
strategy:
matrix:
python-version: ["3.10"]
name: deploy release
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build package for PyPI
run: |
python -m pip install --upgrade pip setuptools wheel
python setup.py sdist bdist_wheel --universal
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_OAUTH }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
pass:
needs: [test, testwq]
runs-on: ubuntu-latest
steps:
- run: echo "All jobs passed"