forked from morganzero/cloudflare-companion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update set_data method to accept an optional callback parameter
when callback is set, the data is stored in the subscriber's queue, otherwise, the data is stored in all subscribers' queues.
- Loading branch information
Showing
27 changed files
with
404 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--container-architecture linux/arm64 | ||
--container-options --security-opt label:disable | ||
--action-offline-mode | ||
--artifact-server-path /tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# syntax=docker/dockerfile:1.0 | ||
|
||
# Builder image | ||
FROM debian:bookworm-slim AS builder | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,69 @@ | ||
name: Install Python with Rye | ||
--- | ||
name: Setup Rye | ||
description: Install Python with Rye | ||
|
||
inputs: | ||
python-version: | ||
description: Python version | ||
required: true | ||
required: false | ||
rye-version: | ||
description: Rye version | ||
required: false | ||
default: "latest" | ||
|
||
outputs: | ||
python-version: | ||
description: The Python version to use | ||
value: ${{ steps.compute-python-version.outputs.python-version }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Compute Python Version | ||
id: compute-python-version | ||
run: | | ||
PYTHON_VERSION="${{ inputs.python-version }}" | ||
if [ -z "$PYTHON_VERSION" ]; then | ||
PYTHON_VERSION=$(cat .python-version) | ||
fi | ||
if [ -z "$PYTHON_VERSION" ]; then | ||
echo "No Python version specified, and no .python-version file found" | ||
exit 1 | ||
fi | ||
echo "Python version specified: $PYTHON_VERSION" | ||
echo "python-version=$PYTHON_VERSION" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Install Rye | ||
uses: eifinger/setup-rye@v3 | ||
uses: eifinger/setup-rye@v4 | ||
with: | ||
enable-cache: true | ||
version: ${{ inputs.rye-version }} | ||
cache-prefix: ${{ steps.compute-python-version.outputs.python-version }} | ||
|
||
- name: Set Rye Config | ||
run: | | ||
rye config --set-bool behavior.global-python=true | ||
rye config --set-bool behavior.use-uv=true | ||
shell: bash | ||
|
||
- name: Set up Python ${{ inputs.python-version }} | ||
- name: Pin Python Version ${{ steps.compute-python-version.outputs.python-version }} | ||
run: | | ||
export PYTHONUNBUFFERED=True | ||
rye pin ${{ inputs.python-version }} | ||
rye pin ${{ steps.compute-python-version.outputs.python-version }} | ||
shell: bash | ||
|
||
- name: Install Dependencies | ||
run: rye sync | ||
- name: Install dependencies | ||
if: steps.setup-rye.outputs.cache-hit != 'true' | ||
run: | | ||
if [ -f requirements.lock ] && [ -f requirements-dev.lock ]; then | ||
rye sync --no-lock | ||
else | ||
rye sync | ||
fi | ||
shell: bash | ||
|
||
- name: Cache pre-commit | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-|${{ steps.compute-python-version.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
interval: weekly | ||
commit-message: | ||
prefix: "chore(rye)" | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
interval: weekly | ||
commit-message: | ||
prefix: "chore(github-actions)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: Actions CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint-actions: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint GitHub Actions | ||
uses: eifinger/actionlint-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
name: Code CI | ||
|
||
on: | ||
|
||
push: | ||
branches: [ main ] | ||
|
||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python with Rye | ||
uses: ./.github/actions/setup-python-with-rye | ||
|
||
- name: Lint | ||
run: rye run ruff check --output-format=github . | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python with Rye | ||
uses: ./.github/actions/setup-python-with-rye | ||
|
||
- name: Format | ||
run: rye run ruff format . --check --diff | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} with Rye | ||
uses: ./.github/actions/setup-python-with-rye | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run Pytest if directory exists | ||
run: rye run pytest --cov=src --cov-report=xml --junitxml=junit.xml | ||
|
||
- name: Upload test results to Codecov | ||
if: ${{ !env.ACT }} | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
fail_ci_if_error: true | ||
file: junit.xml | ||
flags: ${{ matrix.python-version }} | ||
name: ${{ github.repository }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload Coverage files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-xml | ||
path: coverage.xml | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
if: ${{ always() && ! cancelled() }} | ||
|
||
steps: | ||
- name: Download coverage.xml | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage-xml | ||
path: . | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
if: ${{ !env.ACT }} | ||
with: | ||
fail_ci_if_error: true | ||
file: coverage.xml | ||
flags: unittests | ||
name: ${{ github.repository }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.