Skip to content

Merge pull request #7122 from michmx/v7r3-introducing-job-status-scou… #3758

Merge pull request #7122 from michmx/v7r3-introducing-job-status-scou…

Merge pull request #7122 from michmx/v7r3-introducing-job-status-scou… #3758

Workflow file for this run

name: Python 3 tests
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
shellcheck:
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC'
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Run shellcheck
# TODO This should cover more than just tests/CI
# Excluded codes related to sourcing files
# SC1090: Can't follow non-constant source
# SC1091: Not following sourced file
run: |
find tests/CI -name '*.sh' -print0 | xargs -0 -n1 shellcheck --exclude=SC1090,SC1091 --external-source
pycodestyle:
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC'
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Installing dependencies
run: |
python -m pip install pycodestyle
- name: Run pycodestyle
run: |
if [[ "${REFERENCE_BRANCH}" != "" ]]; then
git remote add upstream https://github.com/DIRACGrid/DIRAC.git
git fetch --no-tags upstream "${REFERENCE_BRANCH}"
git branch -vv
git diff -U0 "upstream/${REFERENCE_BRANCH}" ':(exclude)tests/formatting/pep8_bad.py' | pycodestyle --diff
fi
check:
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC'
timeout-minutes: 30
defaults:
# Activate the conda environment automatically in each step
run:
shell: bash -l {0}
strategy:
fail-fast: False
matrix:
command:
# TODO These three tests fail on Python 3:
# * `test_BaseType_Unicode` and `test_nestedStructure` fail due to
# DISET's string and unicode types being poorly defined
- pytest --runslow -k 'not test_BaseType_Unicode and not test_nestedStructure'
- pylint -j 0 -E src/
steps:
- uses: actions/checkout@v3
- name: Fail-fast for outdated pipelines
run: .github/workflows/fail-fast.sh
- uses: conda-incubator/setup-miniconda@master
with:
environment-file: environment-py3.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: Run tests
run: |
# FIXME: The unit tests currently only work with editable installs
pip install -e .[server,testing]
${{ matrix.command }}
env:
REFERENCE_BRANCH: ${{ github['base_ref'] || github['head_ref'] }}