diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15abf468..9f819f4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,28 +15,18 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - name: Run tests and collect coverage - run: pytest --cov app + run: pytest --cov --junitxml=junit.xml - name: Upload coverage to Codecov (arg token) uses: codecov/codecov-action@main with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} + slug: test-org-20241/example-python verbose: true - - name: Upload coverage to Codecov (env token) - uses: codecov/codecov-action@main - with: - fail_ci_if_error: true - verbose: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Upload coverage to Codecov (no token) - uses: codecov/codecov-action@main - with: - fail_ci_if_error: true - verbose: true - - name: Upload coverage to Codecov (oidc) - uses: codecov/codecov-action@main + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 with: - fail_ci_if_error: true - use_oidc: true - verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + + diff --git a/.github/workflows/enforce-license-compliance.yml b/.github/workflows/enforce-license-compliance.yml index 86be7410..8b137891 100644 --- a/.github/workflows/enforce-license-compliance.yml +++ b/.github/workflows/enforce-license-compliance.yml @@ -1,14 +1 @@ -name: Enforce License Compliance -on: - pull_request: - branches: [main, master] - -jobs: - enforce-license-compliance: - runs-on: ubuntu-latest - steps: - - name: 'Enforce License Compliance' - uses: getsentry/action-enforce-license-compliance@57ba820387a1a9315a46115ee276b2968da51f3d # main - with: - fossa_api_key: ${{ secrets.FOSSA_API_KEY }} diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 00000000..c73e032c --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/app/calculator.py b/app/calculator.py index 4f380e8e..be32d0cf 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -1,6 +1,7 @@ class Calculator: def add(x, y): + print("HI") return x + y def subtract(x, y):