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
10 changes: 5 additions & 5 deletions .github/workflows/compatibility_check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Compatibility Check Workflow
name: Compatibility Check

on:
workflow_dispatch:
Expand Down Expand Up @@ -27,12 +27,12 @@ jobs:
run: sudo bash compatibility_matrix.sh 3

- name: Commit and Push if not on main branch
env:
MY_PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
if: github.ref_name != 'main'
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Update compatibility matrix and badges"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
git commit -m "Update compatibility matrix and badges" -a || echo "No changes to commit"
git push https://${MY_PERSONAL_TOKEN}@github.com/${{ github.repository }} HEAD:${{ github.ref_name }}
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
[![GitHub issues](https://img.shields.io/github/issues/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/pulls)
[![GitHub contributors](https://img.shields.io/github/contributors/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/graphs/contributors)
[![GitHub forks](https://img.shields.io/github/forks/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/forks)
[![GitHub stars](https://img.shields.io/github/stars/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/stargazers)
[![GitHub license](https://img.shields.io/github/license/adamspd/django-appointment)](https://github.com/adamspd/django-appointment/blob/main/LICENSE)
[![Django compatible version](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/adamspd/django-appointment/main/django_compatible.json)](https://github.com/adamspd/django-appointment/blob/main/compatibility_matrix.md)
[![Python compatible version](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/adamspd/django-appointment/main/python_compatible.json)](https://github.com/adamspd/django-appointment/blob/main/compatibility_matrix.md)


⚠️ **IMPORTANT**: If upgrading from a version before 2.x.x, please note significant database changes were introduced in
version 2.0.0. Please read
Expand Down Expand Up @@ -142,7 +148,8 @@ see their [release notes](https://github.com/adamspd/django-appointment/tree/mai
}
```

5. Next would be to run `python manage.py migrate` to create the appointment models.
5. Next would be to create the migrations and run them by doing `python manage.py makemigrations appointment` and right
after, run `python manage.py migrate` to create the appointment models.

6. Start the Django Q cluster with `python manage.py qcluster`.

Expand Down Expand Up @@ -257,6 +264,13 @@ Here's how you can set it up:
2. Modify these values as needed for your application, and the app will adapt to the new settings.
3. For further customization, you can extend the provided models, views, and templates or create your own.

## Compatibility Matrix 📊

A compatibility matrix is available to help you determine which versions of Django and Python are compatible with the
package.
The matrix is updated regularly to reflect the latest compatibility test results. For more information, please
refer to the [compatibility matrix here](https://github.com/adamspd/django-appointment/blob/main/compatibility_matrix.md).

## Support 💬

For support or inquiries regarding the Appointment Scheduler app, please refer to the documentation in the "docs"
Expand Down
37 changes: 24 additions & 13 deletions compatibility_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,37 @@ generate_badge_json() {
local combined_key="${dj_ver}_${py_ver}"
# shellcheck disable=SC2155
local result=$(jq -r --arg key "$combined_key" '.[$key]' "$result_file")
echo "Checking result for $combined_key: $result"
if [[ "$result" == "PASS" ]]; then
python_compatible+=("$py_ver")
django_compatible+=("$dj_ver")
# shellcheck disable=SC2076
if ! [[ " ${python_compatible[*]} " =~ " ${py_ver} " ]]; then
python_compatible+=("$py_ver")
fi
# shellcheck disable=SC2076
if ! [[ " ${django_compatible[*]} " =~ " ${dj_ver} " ]]; then
django_compatible+=("$dj_ver")
fi
fi
done
done

echo "Python compatible versions: ${python_compatible[*]}"
echo "Django compatible versions: ${django_compatible[*]}"
# Remove duplicates and sort versions
readarray -t unique_python_versions < <(printf '%s\n' "${python_compatible[@]}" | sort -uV)
readarray -t unique_django_versions < <(printf '%s\n' "${django_compatible[@]}" | sort -uV)

echo "Python compatible versions: ${unique_python_versions[*]}"
echo "Django compatible versions: ${unique_django_versions[*]}"

echo "{
\"schemaVersion\": 1,
\"label\": \"python\",
\"message\": \"$(IFS=, ; echo "${python_compatible[*]}")\",
\"label\": \"compatible python\",
\"message\": \"$(IFS=' | '; echo "${unique_python_versions[*]}")\",
\"color\": \"blue\"
}" > "python_compatible.json"

echo "{
\"schemaVersion\": 1,
\"label\": \"django\",
\"message\": \"$(IFS=, ; echo "${django_compatible[*]}")\",
\"label\": \"compatible django\",
\"message\": \"$(IFS=' | '; echo "${unique_django_versions[*]}")\",
\"color\": \"blue\"
}" > "django_compatible.json"
}
Expand All @@ -131,16 +140,17 @@ post_cleanup() {

echo "Removing docker images..."
# shellcheck disable=SC2155
local dangling_images=$(docker images -q --filter "dangling=true")
if [ -n "$dangling_images" ]; then
docker rmi "$dangling_images"
fi
# local dangling_images=$(docker images -q --filter "dangling=true")
# if [ -n "$dangling_images" ]; then
# docker rmi "$dangling_images"
# fi

echo "Cleanup complete."
}

# Define directories and files
result_dir="test_results"
post_cleanup # Clean up any previous test results
result_file="${result_dir}/results.json"

# Compatible Python versions for each Django version with prefixed keys
Expand Down Expand Up @@ -184,5 +194,6 @@ generate_markdown_table
echo "Compatibility matrix has been generated: compatibility_matrix.md"
echo "Generating compatibility badges..."
generate_badge_json
echo "Compatibility badges have been generated: python_compatible.json, django_compatible.json"
echo "Cleaning up..."
post_cleanup