Skip to content

Commit

Permalink
Merge branch 'main' into issue-1386
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik authored Jun 13, 2024
2 parents 8dd2b26 + bb6997f commit 52eb1a5
Show file tree
Hide file tree
Showing 116 changed files with 1,232 additions and 1,034 deletions.
1 change: 1 addition & 0 deletions .codespell-whitelist.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dependant
unsecure
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: Check docs for broken links

on:
workflow_run:
workflows: ["pages-build-deployment"]
types: [completed]
types:
- completed
workflows:
- Deploy Docs to GitHub Pages

jobs:
check-broken-link:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Deploy Docs
name: Deploy Docs to GitHub Pages

on:
push:
branches:
Expand All @@ -10,6 +11,7 @@ on:

permissions:
contents: write

jobs:
deploy_docs:
runs-on: ubuntu-latest
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/docs_update-references.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Generate API References documentation

on:
pull_request:
types:
- opened
- synchronize
paths:
- faststream/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
check-docs-changes:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -e ".[dev]"
- name: Run build docs
run: bash scripts/build-docs.sh
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "docs: generate API References"
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Update Release Notes
name: Create PR with updated Release Notes

on:
workflow_dispatch: null
push:
tags:
- '*'
release:
types:
- published

jobs:
update-release-notes:
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/codeql.yml → .github/workflows/pr_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@
name: "CodeQL"

on:
push:
branches: [ "main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
types:
- opened
- synchronize
branches:
- main
paths:
- faststream/**
schedule:
- cron: '39 20 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
analyze:
if: github.event.pull_request.draft == false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

on:
pull_request:
types:
- opened
- synchronize
branches:
- main
paths:
- pyproject.toml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
Expand Down
127 changes: 60 additions & 67 deletions .github/workflows/test.yaml → .github/workflows/pr_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: Test
name: Run all tests

on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
pull_request:
types: [opened, synchronize]
types:
- opened
- synchronize
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions
merge_group:
types:
- checks_requested

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
static_analysis:
Expand Down Expand Up @@ -40,27 +48,7 @@ jobs:
shell: bash
run: semgrep scan --config auto --error

check-docs-changes:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -e ".[dev]"
- name: Run build docs
run: bash scripts/build-docs.sh
- name: Check for changes
id: git-diff
run: git diff --exit-code

test:
test-basic:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -165,8 +153,28 @@ jobs:
- name: Test
run: bash scripts/test.sh -m "(slow and (not nats and not kafka and not confluent and not rabbit and not redis)) or (not nats and not kafka and not confluent and not rabbit and not redis)"

test-kafka-smoke:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[kafka,test-core]
- name: Test
run: bash scripts/test.sh -m "not kafka" tests/brokers/kafka/test_test_client.py

test-kafka-real:
if: github.event.pull_request.draft == false
needs:
- test-basic
- test-kafka-smoke
runs-on: ubuntu-latest
services:
kafka:
Expand Down Expand Up @@ -208,7 +216,7 @@ jobs:
path: coverage
if-no-files-found: error

test-kafka-smoke:
test-confluent-smoke:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
Expand All @@ -221,12 +229,15 @@ jobs:
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[kafka,test-core]
run: pip install .[confluent,test-core]
- name: Test
run: bash scripts/test.sh -m "not kafka" tests/brokers/kafka/test_test_client.py
run: bash scripts/test.sh -m "not confluent" tests/brokers/confluent/test_test_client.py

test-confluent-real:
if: github.event.pull_request.draft == false
needs:
- test-basic
- test-confluent-smoke
runs-on: ubuntu-latest
services:
kafka:
Expand Down Expand Up @@ -268,7 +279,7 @@ jobs:
path: coverage
if-no-files-found: error

test-confluent-smoke:
test-rabbit-smoke:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
Expand All @@ -281,12 +292,15 @@ jobs:
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[confluent,test-core]
run: pip install .[rabbit,test-core]
- name: Test
run: bash scripts/test.sh -m "not confluent" tests/brokers/confluent/test_test_client.py
run: bash scripts/test.sh -m "not rabbit" tests/brokers/rabbit/test_test_client.py

test-rabbit-real:
if: github.event.pull_request.draft == false
needs:
- test-basic
- test-rabbit-smoke
runs-on: ubuntu-latest
services:
rabbitmq:
Expand Down Expand Up @@ -317,7 +331,7 @@ jobs:
path: coverage
if-no-files-found: error

test-rabbit-smoke:
test-nats-smoke:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
Expand All @@ -330,12 +344,15 @@ jobs:
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[rabbit,test-core]
run: pip install .[nats,test-core]
- name: Test
run: bash scripts/test.sh -m "not rabbit" tests/brokers/rabbit/test_test_client.py
run: bash scripts/test.sh -m "not nats" tests/brokers/nats/test_test_client.py

test-nats-real:
if: github.event.pull_request.draft == false
needs:
- test-basic
- test-nats-smoke
runs-on: ubuntu-latest
services:
nats:
Expand Down Expand Up @@ -366,7 +383,7 @@ jobs:
path: coverage
if-no-files-found: error

test-nats-smoke:
test-redis-smoke:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
Expand All @@ -379,13 +396,16 @@ jobs:
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[nats,test-core]
run: pip install .[redis,test-core]
- name: Test
run: bash scripts/test.sh -m "not nats" tests/brokers/nats/test_test_client.py
run: bash scripts/test.sh -m "not redis" tests/brokers/redis/test_test_client.py

test-redis-real:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs:
- test-basic
- test-redis-smoke
services:
nats:
image: redis:alpine
Expand Down Expand Up @@ -415,27 +435,10 @@ jobs:
path: coverage
if-no-files-found: error

test-redis-smoke:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: pyproject.toml
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[redis,test-core]
- name: Test
run: bash scripts/test.sh -m "not redis" tests/brokers/redis/test_test_client.py

coverage-combine:
if: github.event.pull_request.draft == false
needs:
- test
- test-basic
- test-kafka-real
- test-confluent-real
- test-rabbit-real
Expand Down Expand Up @@ -478,20 +481,10 @@ jobs:

needs:
- static_analysis
- check-docs-changes
- coverage-combine
- test-macos-latest
- test-windows-latest
- test-kafka-real
- test-kafka-smoke
- test-confluent-real
- test-confluent-smoke
- test-rabbit-real
- test-rabbit-smoke
- test-nats-real
- test-nats-smoke
- test-redis-real
- test-redis-smoke
- test-orjson

runs-on: ubuntu-latest

Expand Down
Loading

0 comments on commit 52eb1a5

Please sign in to comment.