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 1798a944..15abf468 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,28 +3,40 @@ on: [push, pull_request] jobs: run: runs-on: ubuntu-latest + permissions: + id-token: write steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Set up Python 3.10 uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install dependencies run: pip install -r requirements.txt - - name: Run ATS - uses: codecov/codecov-ats@v0 - env: - CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Run tests and collect coverage - run: pytest --cov app ${{ env.CODECOV_ATS_TESTS }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + run: pytest --cov app + - 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: - flags: smart-tests + 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/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/requirements.txt b/requirements.txt index 1f157f03..f1e325af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -attrs==23.2.0 -coverage==7.5.2 -iniconfig==2.0.0 -packaging==24.0 +attrs==25.3.0 +coverage==7.8.0 +iniconfig==2.1.0 +packaging==24.2 pluggy==1.5.0 py==1.11.0 -pyparsing==3.1.2 -pytest==8.2.1 -pytest-cov==5.0.0 -tomli==2.0.1 +pyparsing==3.2.3 +pytest==8.3.5 +pytest-cov==6.1.0 +tomli==2.2.1