Jelajahi Sumber

Fix Codecov integration with Github Actions (#291)

Fixed integration with codecov.io
Added CI run with develop mode installation
Added time measuring in CI tests

Co-authored-by: Max Ryabinin <mryabinin0@gmail.com>
Michael Diskin 4 tahun lalu
induk
melakukan
fdf92e5dc4
2 mengubah file dengan 33 tambahan dan 7 penghapusan
  1. 32 6
      .github/workflows/run-tests.yml
  2. 1 1
      codecov.yml

+ 32 - 6
.github/workflows/run-tests.yml

@@ -33,10 +33,7 @@ jobs:
       - name: Test
         run: |
           cd tests
-          pytest --cov=hivemind 
-      - name: Upload to codecov
-        run: |
-          codecov
+          pytest --durations=0 --durations-min=1.0
 
   build_and_test_p2pd:
     runs-on: ubuntu-latest
@@ -46,12 +43,12 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v2
         with:
-          python-version: 3.8
+          python-version: '3.8'
       - name: Cache dependencies
         uses: actions/cache@v2
         with:
           path: ~/.cache/pip
-          key: Key-v1-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
+          key: Key-v1-3.8-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
@@ -64,3 +61,32 @@ jobs:
         run: |
           cd tests
           pytest -k "p2p" 
+
+  codecov_in_develop_mode:
+
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: '3.8'
+      - name: Cache dependencies
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: Key-v1-3.8-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          pip install -r requirements-dev.txt
+      - name: Build hivemind
+        run: |
+          pip install -e .
+      - name: Test
+        run: |
+          pytest --cov=hivemind tests
+      - name: Upload coverage to Codecov
+        uses: codecov/codecov-action@v1

+ 1 - 1
codecov.yml

@@ -6,7 +6,7 @@ coverage:
   status:
     patch:
       default:
-        informational: false
+        informational: true
     project:
       default:
         threshold: 1%