1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 01:52:20 +03:00
Workflow config file is invalid. Please check your config file: yaml: line 15: did not find expected key
Athanasius 063a83b8e8 Move 'Show github context' to just before flake8
$GITHUB_EVENT_PATH wasn't set in the shell with it first.
2020-07-31 13:17:56 +01:00

76 lines
3.1 KiB
YAML

# This workflow will:
#
# * install Python dependencies
# * lint with a single version of Python
#
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: PR-Checks
on:
pull_request:
branches: [ develop ]
jobs:
flake8:
runs-on: ubuntu-18.04
####################################################################
# Checkout the necessary commits
####################################################################
# We need the commits from the 'head' of the PR, not what it's
# based on.
- name: Checkout commits
# https://github.com/actions/checkout
uses: actions/checkout@v2
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
####################################################################
####################################################################
# Get Python set up
####################################################################
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; elif [ -f requirements.txt ]; then pip install -r requirements.txt ; fi
####################################################################
####################################################################
# Show full github context to aid debugging.
####################################################################
steps:
- name: Show github context
run: |
env
cat $GITHUB_EVENT_PATH
####################################################################
####################################################################
# Lint with flake8
####################################################################
- name: Lint with flake8
env:
BASE_REPO_URL: ${{github.event.pull_request.base.repo.svn_url}}
BASE_REPO_OWNER: ${{github.event.pull_request.base.repo.owner.login}}
BASE_REF: ${{github.base_ref}}
run: |
# We have checked out the 'head' repo, so we need the references
# for the 'base' repo in order to do the 'git diff' below
# So, add the 'base' repo as a new remote
git remote add ${BASE_REPO_OWNER} ${BASE_REPO_URL}
# And then fetch its references
git fetch ${BASE_REPO_OWNER}
# stop the build if there are Python syntax errors or undefined names, ignore existing
git diff "refs/remotes/${BASE_REPO_OWNER}/${BASE_REF}" -- | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --diff
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
git diff "refs/remotes/${BASE_REPO_OWNER}/${BASE_REF}" -- | flake8 . --count --exit-zero --statistics --diff
####################################################################