-
-
Notifications
You must be signed in to change notification settings - Fork 20
CI: Add macOS and Windows to test matrix #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6048ef9
e2d0a27
cbb5620
9cf1968
dc5a92f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Manual Verify Installation | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Specific version to install (optional, defaults to latest)' | ||
| required: false | ||
| default: '' | ||
|
|
||
| jobs: | ||
| verify-pypi-install: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| python-version: ["3.13"] | ||
| steps: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install PyOctaveBand | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| if [ -z "${{ inputs.version }}" ]; then | ||
| pip install pyoctaveband | ||
| else | ||
| pip install pyoctaveband==${{ inputs.version }} | ||
| fi | ||
| shell: bash | ||
|
|
||
| - name: Verify Import | ||
| run: python -c "import pyoctaveband; print('Successfully imported pyoctaveband version:', pyoctaveband.__version__)" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,12 +36,14 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| run: bandit -r src | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| tests: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: ["3.11", "3.12", "3.13"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: ["3.13"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python ${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -54,18 +56,18 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements-dev.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
56
to
58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Use On Windows runners, Suggested implementation: |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -e . | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install . | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| NUMBA_DISABLE_JIT: 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pytest --junitxml=test-results-${{ matrix.python-version }}.xml --cov=src --cov-report=xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pytest --junitxml=test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=src --cov-report=xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload Test Results | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: test-results-${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: test-results-${{ matrix.os }}-${{ matrix.python-version }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-results-${{ matrix.python-version }}.xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| coverage.xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
65
to
72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Consider aligning coverage artifact usage with the Sonar coverage job to avoid producing unused coverage artifacts for non-ubuntu runners. With the new matrix, every (os, python-version) now uploads JUnit +
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -80,7 +82,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download coverage report | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: test-results-3.13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: test-results-ubuntu-latest-3.13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: SonarCloud Scan | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: SonarSource/sonarqube-scan-action@master | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 2 months ago
In general, fix this by explicitly specifying a
permissionsblock, either at the workflow root (applies to all jobs) or at the individual job level, granting only what is necessary. For this workflow, the job only installs and imports a Python package and does not require write access to repository contents, issues, or pull requests, socontents: readis a safe minimal scope. If even repository contents are not needed, this is still the standard minimum GitHub recommends for most workflows.The single best fix with minimal behavior change is to add a workflow-level
permissionsblock after thename:declaration and beforeon:in.github/workflows/manual_verify_install.yml, settingcontents: read. This will apply to theverify-pypi-installjob without altering any steps or behavior; it only restricts the defaultGITHUB_TOKENscope. No new imports, actions, or steps are required.Concretely:
Edit
.github/workflows/manual_verify_install.yml.Insert:
after line 1 (
name: Manual Verify Installation) and before theon:block.No other files or lines need to change.