diff --git a/.circleci/config.yml b/.circleci/config.yml index a01741de..fe5ae248 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 orbs: - codecov: codecov/codecov@3 + codecov: codecov/codecov@4 jobs: build: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bce60d5..15abf468 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ on: [push, pull_request] jobs: run: runs-on: ubuntu-latest + permissions: + id-token: write steps: - name: Checkout uses: actions/checkout@v4 @@ -14,7 +16,27 @@ jobs: run: pip install -r requirements.txt - name: Run tests and collect coverage run: pytest --cov app - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4-beta + - name: Upload coverage to Codecov (arg token) + uses: codecov/codecov-action@main + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + 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 + with: + fail_ci_if_error: true + use_oidc: true + verbose: true diff --git a/.github/workflows/enforce-license-compliance.yml b/.github/workflows/enforce-license-compliance.yml new file mode 100644 index 00000000..86be7410 --- /dev/null +++ b/.github/workflows/enforce-license-compliance.yml @@ -0,0 +1,14 @@ +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/.gitignore b/.gitignore new file mode 100644 index 00000000..c18dd8d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/app/__pycache__/__init__.cpython-39.pyc b/app/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index d38e9303..00000000 Binary files a/app/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/app/__pycache__/calculator.cpython-39.pyc b/app/__pycache__/calculator.cpython-39.pyc deleted file mode 100644 index a39eb26f..00000000 Binary files a/app/__pycache__/calculator.cpython-39.pyc and /dev/null differ diff --git a/app/__pycache__/test_calculator.cpython-39-pytest-7.1.1.pyc b/app/__pycache__/test_calculator.cpython-39-pytest-7.1.1.pyc deleted file mode 100644 index 7e1f15b7..00000000 Binary files a/app/__pycache__/test_calculator.cpython-39-pytest-7.1.1.pyc and /dev/null differ diff --git a/app/calculator.py b/app/calculator.py index 8a976b25..4f380e8e 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -13,3 +13,4 @@ def divide(x, y): if y == 0: return 'Cannot divide by 0' return x * 1.0 / y + diff --git a/bitrise.yml b/bitrise.yml new file mode 100644 index 00000000..a09c296d --- /dev/null +++ b/bitrise.yml @@ -0,0 +1,34 @@ +format_version: "13" +default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git +project_type: other +workflows: + primary: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@8: {} + - script@1: + inputs: + - script_file_path: null + - content: | + #!/usr/bin/env bash + set -e + set -o pipefail + set -x # debug log + + pip3 install -r requirements.txt + pytest --cov app + - codecov@3: + inputs: + - OS: macos + - CODECOV_TOKEN: $CODECOV_TOKEN + - deploy-to-bitrise-io@2: {} +meta: + bitrise.io: + stack: osx-xcode-14.3.x-ventura + machine_type_id: g2-m1.4core +trigger_map: +- push_branch: main + workflow: primary +- pull_request_source_branch: '*' + workflow: primary diff --git a/codecov.yml b/codecov.yml index 6f151f75..1ed5513f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,13 @@ -profiling: - critical_files_paths: - - app/calculator.py +flag_management: + individual_flags: + - name: smart-tests + carryforward: true + carryforward_mode: "labels" + statuses: + - type: "project" + - type: "patch" -comment: - show_critical_paths: true +cli: + plugins: + pycoverage: + report_type: "json" diff --git a/requirements.txt b/requirements.txt index c16954d5..e3a6d253 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -attrs==23.1.0 -coverage==7.3.1 -iniconfig==2.0.0 -packaging==23.1 -pluggy==1.3.0 +attrs==25.3.0 +coverage==7.9.1 +iniconfig==2.1.0 +packaging==25.0 +pluggy==1.6.0 py==1.11.0 -pyparsing==3.1.1 -pytest==7.4.2 -pytest-cov==4.1.0 -tomli==2.0.1 +pyparsing==3.2.3 +pytest==8.4.1 +pytest-cov==6.2.1 +tomli==2.2.1 diff --git a/tests.py b/tests.py deleted file mode 100644 index 6503da36..00000000 --- a/tests.py +++ /dev/null @@ -1,18 +0,0 @@ -import unittest - -import awesome - - -class TestMethods(unittest.TestCase): - def test_add(self): - self.assertEqual(awesome.smile(), ":)") - - def test_add_again(self): - self.assertEqual(awesome.smile(), ":)") - - def test_if(self): - self.assertTrue(awesome.test_if(1)) - - -if __name__ == '__main__': - unittest.main()
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: