From b30d57d411366bf1e5379c8c8ccdfe12499aa26b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 28 Jul 2020 15:12:17 +0100 Subject: [PATCH] pr-checks: Changed to pull_request and fleshed out * Name all steps * After checkout@v2 fetch: 1) checkout base_ref, 2) checkout head_ref * Set and use BASE_REF env var --- .github/workflows/pr-checks.yml | 42 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index ba8367c7..b7bcd108 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -5,21 +5,30 @@ # # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Push-Checks +name: PR-Checks on: - push: + pull_request: branches: [ develop ] jobs: - build: - + flake8: runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 + -name: Checkout commits + uses: actions/checkout@v2 with: fetch-depth: 0 + -name: Checkout base ref + uses: actions/checkout@v2 + with: + ref: ${{github.base_ref}} + -name: Checkout head of PR + uses: actions/checkout@v2 + with: + ref: ${{github.head_ref}} + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: @@ -29,26 +38,13 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + - name: Lint with flake8 env: - ROOT_SHA: ${{github.base_ref}} - + BASE_REF: ${{github.base_ref}} + run: | - DATA=$(python3 <