From 0b1bb863937e9b25cd40912091864c6ed74873b3 Mon Sep 17 00:00:00 2001
From: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
Date: Wed, 18 Oct 2023 21:05:25 +0300
Subject: [PATCH] Improvements for `.github/workflows/run-tests.yaml`

* Configure action `concurrency:`
* Use `codecov/codecov-action@v3` flags (might ... help codecov, somehow)
* Upload testing artifacts
* Add the Codecov badge in the README.md

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
---
 .github/workflows/run-tests.yaml | 12 ++++++++++++
 README.md                        |  1 +
 2 files changed, 13 insertions(+)

diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml
index 2a428e0..c0948ce 100644
--- a/.github/workflows/run-tests.yaml
+++ b/.github/workflows/run-tests.yaml
@@ -4,6 +4,10 @@ on:
   push:
   pull_request:
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   test:
     runs-on: ${{ matrix.os }}
@@ -59,5 +63,13 @@ jobs:
       uses: codecov/codecov-action@v3
       with:
         token: ${{ secrets.CODECOV_TOKEN }}
+        flags: ${{ matrix.os }},${{ matrix.python-version }}
         fail_ci_if_error: true
         files: test_artifacts/cobertura.xml
+
+    - name: Create artifacts
+      uses: actions/upload-artifact@v3
+      if: ${{ !cancelled() }}
+      with:
+        name: test-artifacts_${{ matrix.os }}_${{ matrix.python-version }}
+        path: test_artifacts/
diff --git a/README.md b/README.md
index 1749343..d891922 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@
 ![PyPI - Downloads](https://img.shields.io/pypi/dd/pylint-pytest)
 ![PyPI - Version](https://img.shields.io/pypi/v/pylint-pytest)
 ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pylint-pytest)
+[![codecov](https://codecov.io/gh/pylint-dev/pylint-pytest/graph/badge.svg?token=NhZDLKmomd)](https://codecov.io/gh/pylint-dev/pylint-pytest)
 
 A Pylint plugin to suppress pytest-related false positives.