From d518af1f4789776d0812eecf79736398699420b0 Mon Sep 17 00:00:00 2001 From: jscampucci Date: Wed, 25 Jun 2025 17:10:14 +0200 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95a4fc3..dd4a5e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,15 +7,32 @@ on: jobs: - build: - name: Upload coverage reports to Codecov + unit-test: + name: Run unit tests runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Test with pytest + run: | + pytest --cov --junitxml=junit.xml + # Copy and paste the codecov/test-results-action here + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results to Codecov if: ${{ !cancelled() }} uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }}