Browse Source

feat(ci): Python and dev env workflow improvements (#26430)

- Run workflow to test Python 3.6.12 (current) and 3.8.10 (next target) when Python dependencies change
- Dev env workflow do not need to be test when requirements file changes since we test under the Python versions workflow
- Drop running on Catalina
- Bump time outs
- Other minor changes
Armen Zambrano G 3 years ago
parent
commit
3d8bba77bf
2 changed files with 15 additions and 20 deletions
  1. 2 4
      .github/workflows/development-environment.yml
  2. 13 16
      .github/workflows/python-deps.yml

+ 2 - 4
.github/workflows/development-environment.yml

@@ -5,7 +5,6 @@ on:
     - 'Makefile'
     - '.github/workflows/development-environment.yml'
     - '.envrc'
-    - 'requirements*'
     - 'Brewfile'
     - 'scripts/*'
     - 'src/sentry/runner/commands/devserver.py'
@@ -15,14 +14,13 @@ jobs:
   dev-environment:
     name: set up
     runs-on: ${{ matrix.os }}
-    timeout-minutes: 35
+    timeout-minutes: 40
     strategy:
       matrix:
-        # macosx-10.15 is Catalina
         # macosx-11.0 is Big Sur, however, it takes long for jobs to get started
         # Using Ubuntu 18 until I figure out this error:
         # -> ImportError: libffi.so.6: cannot open shared object file: No such file or directory
-        os: [ macos-10.15, macos-11.0, ubuntu-18.04 ]
+        os: [ macos-11.0, ubuntu-18.04 ]
       fail-fast: false
     env:
       PIP_DISABLE_PIP_VERSION_CHECK: on

+ 13 - 16
.github/workflows/python-versions.yml → .github/workflows/python-deps.yml

@@ -1,24 +1,21 @@
-name: python versions
+name: python deps
 on:
-  schedule:
-    # Notifications will be sent to whoever touches this last
-    # You will be able to trigger this workflow manually if need be
-    # This runs at 4:00 every Saturday, where GHA should in theory be less busy.
-    - cron:  '0 4 * * 6'
+  pull_request:
+    paths:
+    - '.github/workflows/python-deps.yml'
+    - 'requirements*'
 
 jobs:
   # This workflow makes sure that Python dependencies install correctly for
-  # a) our current version b) the next version we're targetting and c) a futher along version
-  python-versions:
-    name: set up
+  # a) our current version b) the next version we're targetting
+  python-deps:
+    name: install
     runs-on: ${{ matrix.os }}
-    timeout-minutes: 10
+    timeout-minutes: 20
     strategy:
       matrix:
-        # macosx-10.15 is Catalina
-        # macosx-11.0 is Big Sur, however, it takes long for jobs to get started
-        os: [ macos-10.15, macos-11.0, ubuntu-20.04 ]
-        python-version: [ 3.6, 3.8, 3.9 ]
+        os: [ macos-11.0, ubuntu-20.04 ]
+        python-version: [ 3.6.13, 3.8.10 ]
       fail-fast: false
     env:
       PIP_DISABLE_PIP_VERSION_CHECK: on
@@ -48,9 +45,9 @@ jobs:
           path: |
             ${{ steps.pip.outputs.pip-cache-dir }}
           key: |
-            ${{ matrix.os }}-py${{ matrix.python-version }}-pip${{ steps.pip.outputs.pip-version }}-${{ hashFiles('requirements-*.txt') }}
+            python-deps-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('requirements-*.txt') }}
           restore-keys: |
-            ${{ matrix.os }}-py${{ matrix.python-version }}-pip${{ steps.pip.outputs.pip-version }}
+            python-deps-${{ matrix.os }}-py${{ matrix.python-version }}
 
       - name: Install dependencies
         run: |