From cbbcd55d2356e483bbb53904af37f81c30788645 Mon Sep 17 00:00:00 2001 From: Marcel Rosier Date: Wed, 9 Oct 2024 11:41:16 +0200 Subject: [PATCH 1/5] Try to fix codecov upload --- .github/workflows/tests.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4bfd1e3..5e92219 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,8 +15,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.11", "3.12"] + os: [ubuntu-latest] #, windows-latest, macos-latest] + python-version: ["3.10"] #, "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -26,23 +26,25 @@ jobs: python-version: ${{ matrix.python-version }} cache: "pip" # caching pip dependencies - - name: Install dependencies + - name: Configure poetry run: | python -m pip install --upgrade pip python -m pip install poetry - python -m poetry install - - name: Lint with flake8 + python -m poetry config virtualenvs.in-project true + - name: Cache the virtualenv + uses: actions/cache@v4 + with: + path: ./.venv + key: ${{ matrix.os }}-${{matrix.python-version}}-venv-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies run: | - # stop the build if there are Python syntax errors or undefined names - python -m poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - python -m poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + python -m poetry install - name: Test with pytest run: | python -m poetry run coverage run --source=panoptica -m pytest - name: Upload results to Codecov # Only upload to Codecov after a merge to the main branch - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} + # if: github.ref == 'refs/heads/main' && github.event_name == 'push' + run: | + pip install codecov-cli + codecovcli --verbose upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'job-name'-${{ github.run_id }} -f .coverage From 675ee11f3fed0e56f84ef01ae2208e1d66e88b61 Mon Sep 17 00:00:00 2001 From: Marcel Rosier Date: Wed, 9 Oct 2024 11:46:34 +0200 Subject: [PATCH 2/5] Revert to action but generate xml before --- .github/workflows/tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5e92219..1f7223d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,9 +42,10 @@ jobs: - name: Test with pytest run: | python -m poetry run coverage run --source=panoptica -m pytest + python -m poetry run coverage xml - name: Upload results to Codecov # Only upload to Codecov after a merge to the main branch - # if: github.ref == 'refs/heads/main' && github.event_name == 'push' - run: | - pip install codecov-cli - codecovcli --verbose upload-process --disable-search -t ${{ secrets.CODECOV_TOKEN }} -n 'job-name'-${{ github.run_id }} -f .coverage + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 9646652846e90450d1c2464ace0c7e64382c157f Mon Sep 17 00:00:00 2001 From: Marcel Rosier Date: Wed, 9 Oct 2024 11:48:35 +0200 Subject: [PATCH 3/5] Rm conditional upload for testing purpose --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1f7223d..6a89767 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,7 @@ jobs: python -m poetry run coverage xml - name: Upload results to Codecov # Only upload to Codecov after a merge to the main branch - if: github.ref == 'refs/heads/main' && github.event_name == 'push' + # if: github.ref == 'refs/heads/main' && github.event_name == 'push' uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} From ade513cc7688e0c8b766bea5e2d4e7176de811ac Mon Sep 17 00:00:00 2001 From: Marcel Rosier Date: Wed, 9 Oct 2024 11:57:02 +0200 Subject: [PATCH 4/5] Fix test action Re-add conditional upload Add poetry cache --- .github/workflows/tests.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a89767..4a3750b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,8 +15,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] #, windows-latest, macos-latest] - python-version: ["3.10"] #, "3.11", "3.12"] + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -24,28 +24,22 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: "pip" # caching pip dependencies + cache: "poetry" - name: Configure poetry run: | python -m pip install --upgrade pip python -m pip install poetry - python -m poetry config virtualenvs.in-project true - - name: Cache the virtualenv - uses: actions/cache@v4 - with: - path: ./.venv - key: ${{ matrix.os }}-${{matrix.python-version}}-venv-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies run: | python -m poetry install - - name: Test with pytest + - name: Test with pytest and create coverage report run: | python -m poetry run coverage run --source=panoptica -m pytest python -m poetry run coverage xml - - name: Upload results to Codecov + - name: Upload coverage results to Codecov (Only on merge to main) # Only upload to Codecov after a merge to the main branch - # if: github.ref == 'refs/heads/main' && github.event_name == 'push' + if: github.ref == 'refs/heads/main' && github.event_name == 'push' uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} From 5855ca1d5e1fe99612fe1497dba651e380be65ec Mon Sep 17 00:00:00 2001 From: Marcel Rosier Date: Wed, 9 Oct 2024 12:00:31 +0200 Subject: [PATCH 5/5] Rm buggy poetry caching for now --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4a3750b..6b0d8d9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: "poetry" + cache: "pip" - name: Configure poetry run: |