Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9a-zA-Z]+' # Matches 1.2.3, 1.2.3alpha1 etc.

permissions:
contents: read

jobs:
publish-pypi:
runs-on: ubuntu-latest
Expand All @@ -32,6 +35,8 @@ jobs:
needs: publish-pypi
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create Release
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:
required: true
type: string

permissions:
contents: read

Comment on lines +25 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 3e11ae6. Workflow-level permissions are now contents: read only. pull-requests: write has been moved to a new dedicated coverage-comment job that has if: github.event_name == 'pull_request' at the job level, so it never runs on push to master. The build job uploads code-coverage-results.md as an artifact (for Linux + Python 3.11 only), which the new job downloads before posting the PR comment.

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -112,9 +115,26 @@ jobs:
indicators: true
output: both
thresholds: '50 80'
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
if: runner.os == 'Linux' && matrix.python-version == '3.11'
with:
name: coverage-report
path: code-coverage-results.md

coverage-comment:
needs: build
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write # for sticky-pull-request-comment posting coverage results
steps:
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request' && runner.os == 'Linux' && matrix.python-version == '3.11'
with:
recreate: true
path: code-coverage-results.md
recreate: true
path: code-coverage-results.md
3 changes: 3 additions & 0 deletions .github/workflows/run_tests_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
- cron: '0 6,18 * * *'

permissions:
contents: read

jobs:
sdk-python-tests-prod:
uses: Clarifai/clarifai-python/.github/workflows/run_tests.yml@master
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/run_tests_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
- cron: '0 6,18 * * *'

permissions:
contents: read

jobs:
sdk-python-tests-staging:
uses: Clarifai/clarifai-python/.github/workflows/run_tests.yml@master
Expand Down
2 changes: 1 addition & 1 deletion tests/runners/dummy_vllm_models/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ optimum==1.23.3
openai
clarifai>=11.5.2
psutil
torch==2.6.0
torch==2.8.0
vllm>=0.8.0
transformers>=4.50.1
2 changes: 1 addition & 1 deletion tests/runners/hf_mbart_model/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ requests
sentencepiece>=0.2.0
tiktoken>=0.9.0
tokenizers>=0.21.1
torch==2.6.0
torch==2.8.0
transformers>=4.51.3
Loading