Skip to content
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

chore: update CI triggers to minify useless runs #1483

Merged
merged 27 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
38d1c51
chore: run CQ CI only with PR and by cron
Lancetnik May 29, 2024
1c49bd5
chore: run DR CI only if pyproject changed
Lancetnik May 29, 2024
c78bcc4
format: correct deploy docs CI
Lancetnik May 29, 2024
0c35e2c
chore: run coverage publish CI only after PR merged
Lancetnik May 29, 2024
dadc8ae
chore: run tests only in PR
Lancetnik May 29, 2024
0ea7a6b
chore: fix test CI
Lancetnik May 29, 2024
f88ce8e
chore: add CI workflows names conversation
Lancetnik May 29, 2024
6a7b82b
chore: add docs update references CI
Lancetnik May 29, 2024
f9565a2
chore: make update references CI writeable
Lancetnik May 29, 2024
54c9bee
chore: finalize CI
Lancetnik May 29, 2024
0b6f657
chore: correct name in check links CI
Lancetnik May 29, 2024
4529728
chore: run tests only if required
Lancetnik May 29, 2024
b5e2aae
chore: run CQ CI if required
Lancetnik May 29, 2024
47c08e6
chore: fix broken links CI
Lancetnik May 29, 2024
e186329
chore: make References autocommit
Lancetnik May 30, 2024
81da016
Apply automatic changes
Lancetnik May 30, 2024
e5dee88
chore: change GHA commit message
Lancetnik May 30, 2024
1b835f1
Merge branch 'chore/ci-triggers' of github.com:airtai/faststream into…
Lancetnik May 30, 2024
bc8f197
chore: make extra trigger for tests
Lancetnik May 30, 2024
b5ccc97
chore: update tests triggers
Lancetnik May 30, 2024
d9bd7b2
chore: run tests anyway
Lancetnik May 31, 2024
61bd1db
Merge branch 'main' into chore/ci-triggers
kumaranvpl Jun 3, 2024
18fbe85
chore: add merge queue trigger to CI
Lancetnik Jun 3, 2024
288e42b
Merge branch 'chore/ci-triggers' of github.com:airtai/faststream into…
Lancetnik Jun 3, 2024
cc52bd2
chore: make real testsuites fail-fast
Lancetnik Jun 3, 2024
fa3c922
chore: remove useless conditions in CI
Lancetnik Jun 3, 2024
12d53ec
chore: specify MG trigger
Lancetnik Jun 3, 2024
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
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
34 changes: 34 additions & 0 deletions .github/workflows/docs_update-references.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Generate API References documentation

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

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
11 changes: 7 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,11 +12,14 @@
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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
# 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

permissions:
contents: read
Expand Down
121 changes: 54 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,14 @@
name: Test
name: Run all tests

on:
push:
branches:
- main
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

jobs:
static_analysis:
Expand Down Expand Up @@ -40,27 +42,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 +147,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 +210,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 +223,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 +273,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 +286,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 +325,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 +338,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 +377,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 +390,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 +429,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 +475,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
20 changes: 9 additions & 11 deletions .github/workflows/publish_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: Smokeshow
name: Publish tests coverage to Smokeshow and set coverage % status to commit

on:
workflow_run:
workflows: [Test]
types: [completed]

push:
branches:
- main

permissions:
statuses: write


jobs:
smokeshow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
Expand All @@ -22,15 +19,16 @@ jobs:

- run: pip install smokeshow

- uses: dawidd6/[email protected] # nosemgrep
- uses: dawidd6/[email protected] # nosemgrep
with:
workflow: test.yaml
commit: ${{ github.event.workflow_run.head_sha }}
workflow: pr_tests.yaml
workflow_conclusion: success
if_no_artifact_found: fail

- run: smokeshow upload coverage-html
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 70
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 90
SMOKESHOW_GITHUB_CONTEXT: coverage
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
Expand Down
Loading
Loading