-
Notifications
You must be signed in to change notification settings - Fork 1
Update panel and CI #4
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
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,16 @@ | ||
version: 2 | ||
updates: | ||
# GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
actions: | ||
patterns: | ||
- "*" | ||
# Python | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Python Wheels | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
tags: | ||
- "**" | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: wheels-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash -eux {0} | ||
|
||
jobs: | ||
|
||
build_dist: | ||
name: Build Distribution Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
# Build sdist on lowest supported Python | ||
python-version: '3.9' | ||
|
||
- name: Install build | ||
run: | | ||
python -m pip install build | ||
|
||
- name: build the dist files | ||
run: | | ||
python -m build . | ||
|
||
- name: Upload the dist files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-${{ github.run_id }} | ||
path: ./dist/*.* | ||
|
||
test_dist: | ||
needs: [build_dist] | ||
name: Test Distribution Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
# Build sdist on lowest supported Python | ||
python-version: '3.9' | ||
|
||
- name: Download the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-${{ github.run_id }} | ||
path: dist/ | ||
|
||
- name: Test the sdist | ||
run: | | ||
cd dist | ||
pip install *.tar.gz | ||
python -c "import django_mongodb_extensions" | ||
pip uninstall -y django-mongodb-extensions | ||
|
||
- name: Test the wheel | ||
run: | | ||
cd dist | ||
pip install *.whl | ||
python -c "import django_mongodb_extensions" | ||
pip uninstall -y django-mongodb-extensions | ||
Comment on lines
+49
to
+82
Check warningCode scanning / zizmor default permissions used due to no permissions: block Warning
default permissions used due to no permissions: block
|
||
|
||
publish: | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#publishing-the-distribution-to-pypi | ||
needs: [test_dist] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-${{ github.run_id }} | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Python Tests | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
|
||
concurrency: | ||
group: tests-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash -eux {0} | ||
|
||
env: | ||
MIN_PYTHON: "3.9" | ||
MIN_MONGODB: "4.0" | ||
MAX_MONGODB: "8.0" | ||
|
||
jobs: | ||
static: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
python-version: ${{ matrix.python-version }} | ||
- uses: extractions/setup-just@v3 | ||
- run: just install | ||
- run: just lint | ||
- run: just docs | ||
- run: just doctest | ||
Comment on lines
+22
to
+38
Check warningCode scanning / zizmor default permissions used due to no permissions: block Warning test
default permissions used due to no permissions: block
|
||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
fail-fast: false | ||
name: CPython ${{ matrix.python-version }}-${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
python-version: ${{ matrix.python-version }} | ||
- uses: extractions/setup-just@v3 | ||
- name: Start MongoDB on Linux | ||
if: ${{ startsWith(runner.os, 'Linux') }} | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: ${{ env.MAX_MONGODB }} | ||
mongodb-replica-set: test-rs | ||
- name: Start MongoDB on MacOS | ||
if: ${{ startsWith(runner.os, 'macOS') }} | ||
run: | | ||
brew tap mongodb/brew | ||
brew install mongodb/brew/mongodb-community@${MAX_MONGODB} | ||
brew services start mongodb-community@${MAX_MONGODB} | ||
- name: Start MongoDB on Windows | ||
if: ${{ startsWith(runner.os, 'Windows') }} | ||
shell: powershell | ||
run: | | ||
mkdir data | ||
mongod --remove | ||
mongod --install --dbpath=$(pwd)/data --logpath=$PWD/mongo.log | ||
net start MongoDB | ||
- run: just install | ||
- run: just test | ||
Comment on lines
+39
to
+79
Check warningCode scanning / zizmor default permissions used due to no permissions: block Warning test
default permissions used due to no permissions: block
|
||
|
||
build-min: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
python-version: ${{ env.MIN_PYTHON }} | ||
- uses: extractions/setup-just@v3 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
python-version: ${{ env.MIN_PYTHON }} | ||
- uses: extractions/setup-just@v3 | ||
- uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: ${{ env.MIN_MONGODB }} | ||
mongodb-replica-set: test-rs | ||
- name: Run unit tests with minimum dependency versions | ||
run: | | ||
uv sync --python=${MIN_PYTHON} --resolution=lowest-direct | ||
just test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: GitHub Actions Security Analysis with zizmor | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["**"] | ||
|
||
jobs: | ||
zizmor: | ||
name: zizmor latest via Cargo | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Setup Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Get zizmor | ||
run: cargo install zizmor | ||
- name: Run zizmor | ||
run: zizmor --format sarif . > results.sarif | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: results.sarif | ||
category: zizmor |
Check warning
Code scanning / zizmor
default permissions used due to no permissions: block Warning