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: 10 additions & 0 deletions .github/workflows/ci-app-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ name: CI - app integration test
on:
push:
branches: ["**"]
paths:
- "**.py"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/ci-app-integration-test.yml"
pull_request:
branches: ["**"]
paths:
- "**.py"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/ci-app-integration-test.yml"

jobs:
test:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ name: CI - smoke test
on:
push:
branches: [main]
paths:
- "**.py"
- "pyproject.toml"
- "uv.lock"
- "Dockerfile*"
- "docker-compose*.yml"
- ".github/workflows/ci-smoke-test.yml"
pull_request:
branches: [main]
paths:
- "**.py"
- "pyproject.toml"
- "uv.lock"
- "Dockerfile*"
- "docker-compose*.yml"
- ".github/workflows/ci-smoke-test.yml"

jobs:
smoke:
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/cmd-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Command - Smoke Test

on:
# PR/issue comments only; excludes edits and deletions
issue_comment:
types: [created]
# Allows manual trigger for testing on GitHub Actions CI
workflow_dispatch:
inputs: {}

jobs:
smoke:
# Allow if:
# - Manually triggered (workflow_dispatch), or
# - Comment is "/smoke" on a PR, posted by the PR author
if: |
github.event_name == 'workflow_dispatch' ||
(github.event.comment.body == '/smoke' &&
github.event.issue.pull_request != null &&
github.event.comment.user.login == github.event.issue.user.login)
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
# workflow_dispatch: use github.sha (the selected branch)
# issue_comment: github.sha points to main, so fetch the PR head SHA via API
- name: Set commit SHA
id: set-commit-sha
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
else
SHA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} --jq '.head.sha')
echo "sha=$SHA" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4
with:
ref: ${{ steps.set-commit-sha.outputs.sha }}

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install dependencies
run: uv sync --group dev

- name: Start full stack
run: docker compose --profile app up -d --build --wait

- name: Run smoke tests
id: run-smoke
run: make smoke

- name: Dump logs on failure
if: failure()
run: docker compose --profile app logs

- name: Comment result on PR
if: always() && github.event_name == 'issue_comment'
uses: actions/github-script@v7
with:
script: |
const success = '${{ steps.run-smoke.outcome }}' === 'success'
const status = success ? '✅ passed' : '❌ failed'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Smoke Test ${status} (\`${{ steps.set-commit-sha.outputs.sha }}\`)`
})
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ fabric.properties

package-lock.json
*.db

# else
data/
Loading