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
139 changes: 9 additions & 130 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,139 +1,18 @@
name: CI

# pull_request only. A push trigger alongside it ran the whole suite twice on the same
# SHA, and the duplicate integration legs raced each other against the Stream app
# several SDK repos share. The trade is that a merge to master, and a direct push to it,
# now run nothing: release.yml runs this same workflow only when a release is pending,
# so the gate before a tag is covered but the routine post-merge signal is gone.
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
branches: [ master, main, '*.x' ]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Should Fix] A PR into an N.x hotfix branch gets no tests at all.

This filter is [ master, main ], so a PR into 12.x triggers nothing. release.yml does push-trigger on '*.x', but its tests job is gated on a pending release, so the first time a hotfix is tested is the Release PR merge, when the release is already being cut. The README documents N.x as the supported hotfix path, so this is a live path with no gate.

One-line fix: branches: [ master, main, '*.x' ].

Separately, the comment above overstates the master coverage. release.yml only runs the suite when a release is pending, so an ordinary PR merge to master and a direct push to master (still possible, there is no branch protection) now run nothing. Nothing untested ships, since the Release PR merge is still gated, but the post-merge signal is gone. Worth saying that plainly in the comment rather than "master is covered by release.yml".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both fixed in d886781. The filter is [ master, main, '*.x' ].

The comment now says what is actually true rather than claiming master is covered:

# The trade is that a merge to master, and a direct push to it,
# now run nothing: release.yml runs this same workflow only when a release is pending,
# so the gate before a tag is covered but the routine post-merge signal is gone.

permissions:
contents: read

jobs:
unit:
name: Unit Tests & Code Quality
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.0'

- name: Install dependencies
run: bundle install --jobs 4 --retry 3

- name: Run unit tests
run: make test

- name: Run code quality checks
run: |
make format-check
make lint
make security

integration-chat:
name: Chat Integration Tests
runs-on: ubuntu-latest
environment: ci
if: github.event_name == 'push' || github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.0'

- name: Install dependencies
run: bundle install --jobs 4 --retry 3

- name: Run chat integration tests
env:
STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
STREAM_BASE_URL: ${{ vars.STREAM_BASE_URL }}
run: make test-integration-chat

integration-feed:
name: Feed Integration Tests
runs-on: ubuntu-latest
environment: ci
if: github.event_name == 'push' || github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.0'

- name: Install dependencies
run: bundle install --jobs 4 --retry 3

- name: Run feed integration tests
env:
STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
STREAM_BASE_URL: ${{ vars.STREAM_BASE_URL }}
run: make test-integration-feed

integration-video:
name: Video Integration Tests
runs-on: ubuntu-latest
environment: ci
if: github.event_name == 'push' || github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.0'

- name: Install dependencies
run: bundle install --jobs 4 --retry 3

- name: Run video integration tests
env:
STREAM_API_KEY: ${{ vars.STREAM_VIDEO_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_VIDEO_API_SECRET }}
STREAM_BASE_URL: ${{ vars.STREAM_VIDEO_BASE_URL }}
run: make test-integration-video

integration-gcp-lb:
name: GCP load balancer keep-alive
runs-on: ubuntu-latest
environment: ci

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.0'

- name: Install dependencies
run: bundle install --jobs 4 --retry 3

- name: Run GCP keep-alive integration test
env:
STREAM_API_KEY: ${{ vars.STREAM_GCP_API_KEY || vars.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_GCP_API_SECRET || secrets.STREAM_API_SECRET }}
STREAM_BASE_URL: ${{ vars.STREAM_GCP_BASE_URL }}
run: make test-integration-gcp-lb
tests:
uses: ./.github/workflows/run_tests.yml
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint PR title

on:
pull_request:
types: [opened, edited, reopened, synchronize]

permissions:
pull-requests: read

jobs:
pr_title:
name: 👮 Conventional PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading