mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-07 02:43:22 +03:00
Try a whole new method of referring to 'base', and checkout 'head'
This commit is contained in:
parent
92ea8943df
commit
c5d43a4ada
36
.github/workflows/pr-checks.yml
vendored
36
.github/workflows/pr-checks.yml
vendored
@ -15,28 +15,30 @@ jobs:
|
|||||||
flake8:
|
flake8:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Show full github context to aid debugging.
|
||||||
|
####################################################################
|
||||||
steps:
|
steps:
|
||||||
- name: Show github context
|
- name: Show github context
|
||||||
run: cat $GITHUB_EVENT_PATH
|
run: cat $GITHUB_EVENT_PATH
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Checkout the necessary commits
|
||||||
|
####################################################################
|
||||||
|
# We need the commits from the 'head' of the PR, not what it's
|
||||||
|
# based on.
|
||||||
- name: Checkout commits
|
- name: Checkout commits
|
||||||
# https://github.com/actions/checkout
|
# https://github.com/actions/checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
repository: ${{github.head.repo.full_name}}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
####################################################################
|
||||||
|
|
||||||
- name: Checkout base ref
|
####################################################################
|
||||||
uses: actions/checkout@v2
|
# Get Python set up
|
||||||
with:
|
####################################################################
|
||||||
ref: ${{github.base_ref}}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Checkout head of PR
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
ref: ${{github.head_ref}}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Python 3.7
|
- name: Set up Python 3.7
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
@ -46,13 +48,19 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install flake8
|
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
|
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; elif [ -f requirements.txt ]; then pip install -r requirements.txt ; fi
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Lint with flake8
|
||||||
|
####################################################################
|
||||||
- name: Lint with flake8
|
- name: Lint with flake8
|
||||||
env:
|
env:
|
||||||
|
BASE_REPO: ${{github.base.full_name}}
|
||||||
BASE_REF: ${{github.base_ref}}
|
BASE_REF: ${{github.base_ref}}
|
||||||
|
|
||||||
run: |
|
run: |
|
||||||
# stop the build if there are Python syntax errors or undefined names, ignore existing
|
# stop the build if there are Python syntax errors or undefined names, ignore existing
|
||||||
git diff "refs/remotes/origin/${BASE_REF}" -- | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --diff
|
git diff "refs/remotes/${BASE_REPO}/${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
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||||
git diff "refs/remotes/origin/${BASE_REF}" -- | flake8 . --count --exit-zero --statistics --diff
|
git diff "refs/remotes/${BASE_REPO}/${BASE_REF}" -- | flake8 . --count --exit-zero --statistics --diff
|
||||||
|
####################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user