From 3b30222aa5344572184d2a9b3e39cb4cf16e2c66 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 24 Oct 2024 09:30:06 -0400 Subject: [PATCH 1/2] tweak workflows Fixes variable naming and adds enforcer. --- .github/workflows/enforcer.yml | 16 ++++++++++++++++ .github/workflows/tests.yml | 9 ++------- 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/enforcer.yml diff --git a/.github/workflows/enforcer.yml b/.github/workflows/enforcer.yml new file mode 100644 index 0000000..1fc567f --- /dev/null +++ b/.github/workflows/enforcer.yml @@ -0,0 +1,16 @@ +name: 'Check Branch' + +on: + pull_request: + branches: + - base + +jobs: + check_branch: + runs-on: ubuntu-latest + steps: + - name: Check branch + if: github.head_ref != 'development' + run: | + echo "ERROR: You can only merge to base from the development branch." + exit 1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a122598..d444468 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest environment: - name: ${{ vars.DEV_ENVIRONMENT }} + name: development steps: - name: Checkout Repository @@ -20,12 +20,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.11' - - - name: Cache pip - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip + cache: 'pip' - name: Install dependencies run: pip install tox From aad16d9d5a56db5cc2fe6dafc6b0ecdb67f15e58 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 24 Oct 2024 09:40:00 -0400 Subject: [PATCH 2/2] Remove unnecessary caching Removes pip caching from test workflow --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d444468..ca2f3bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.11' - cache: 'pip' - name: Install dependencies run: pip install tox