Skip to content
Open
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
135 changes: 69 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,69 @@
name: CI

on:
pull_request:
branches: [main, dev]
push:
branches: [dev]
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-test:
name: Build, test & smoke
runs-on: ubuntu-latest
timeout-minutes: 30
# dev -> main is a pure promotion of commits already validated by this same
# workflow (via the feature-branch PR into dev, or the push-to-dev run below).
# Re-running build/test/smoke here would just burn minutes on code we've
# already checked. Any other PR into main (e.g. a hotfix branch) still runs.
if: >-
!(github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.ref == 'dev')

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

- name: Install Zig 0.13.0
run: |
set -euo pipefail
curl -fsSL -o /tmp/zig.tar.xz \
"https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz"
echo "d45312e61ebcc48032b77bc4cf7fd6915c11fa16e4aad116b66c9468211230ea /tmp/zig.tar.xz" | sha256sum -c -
sudo tar -C /usr/local -xf /tmp/zig.tar.xz
echo "/usr/local/zig-linux-x86_64-0.13.0" >> "$GITHUB_PATH"

- name: Build (ReleaseSafe, baseline CPU)
run: |
zig version
zig build -Doptimize=ReleaseSafe -Dcpu=baseline

- name: Unit + integration tests
run: zig build test -Dcpu=baseline

- name: CLI smoke
run: |
set -euo pipefail
./zig-out/bin/bedd version
./zig-out/bin/bedd doctor
./zig-out/bin/bedd skills
./zig-out/bin/bedd tinder validate tinder.example.json
./zig-out/bin/bedd strike inbox demo.event echo
BEDD_SKILLS_DIR=zig-out/skills ./zig-out/bin/bedd strike inbox demo.event echo_skill

- name: Local demo (mock bus)
run: ./zig-out/bin/bedd demo

- name: Bench smoke
run: ./zig-out/bin/bedd bench --iterations 10 --skills echo,redact --json
name: CI

on:
pull_request:
branches: [main, dev]
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE*'
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-test:
name: Build, test & smoke
runs-on: ubuntu-latest
timeout-minutes: 30
# dev -> main is a pure promotion of commits already validated by this same
# workflow (via the feature-branch PR into dev, or the push-to-dev run below).
# Re-running build/test/smoke here would just burn minutes on code we've
# already checked. Any other PR into main (e.g. a hotfix branch) still runs.
if: >-
!(github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.ref == 'dev')

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

- name: Install Zig 0.13.0
run: |
set -euo pipefail
curl -fsSL -o /tmp/zig.tar.xz \
"https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz"
echo "d45312e61ebcc48032b77bc4cf7fd6915c11fa16e4aad116b66c9468211230ea /tmp/zig.tar.xz" | sha256sum -c -
sudo tar -C /usr/local -xf /tmp/zig.tar.xz
echo "/usr/local/zig-linux-x86_64-0.13.0" >> "$GITHUB_PATH"

- name: Build (ReleaseSafe, baseline CPU)
run: |
zig version
zig build -Doptimize=ReleaseSafe -Dcpu=baseline

- name: Unit + integration tests
run: zig build test -Dcpu=baseline

- name: CLI smoke
run: |
set -euo pipefail
./zig-out/bin/bedd version
./zig-out/bin/bedd doctor
./zig-out/bin/bedd skills
./zig-out/bin/bedd tinder validate tinder.example.json
./zig-out/bin/bedd strike inbox demo.event echo
BEDD_SKILLS_DIR=zig-out/skills ./zig-out/bin/bedd strike inbox demo.event echo_skill

- name: Local demo (mock bus)
run: ./zig-out/bin/bedd demo

- name: Bench smoke
run: ./zig-out/bin/bedd bench --iterations 10 --skills echo,redact --json
101 changes: 52 additions & 49 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
name: CodeQL

on:
pull_request:
branches: [main, dev]
push:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing the push: [dev] trigger makes the dev → main skip incorrect. A merge into dev will no longer run CI, but the later dev → main PR is still skipped. We should either keep the push: [dev] trigger or remove the dev → main skip.

branches: [dev]
schedule:
- cron: "17 7 * * 1"
workflow_dispatch:

concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze (actions)
runs-on: ubuntu-latest
timeout-minutes: 30
# Same reasoning as ci.yml: skip the pure dev -> main promotion, since this
# exact code was already scanned on the way into dev. Direct-to-main PRs
# (e.g. hotfixes) and the weekly schedule still run.
if: >-
!(github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.ref == 'dev')

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: actions
config-file: ./.github/codeql/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:actions"
name: CodeQL

on:
pull_request:
branches: [main, dev]
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE*'
schedule:
- cron: "17 7 * * 1"
workflow_dispatch:

concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze (actions)
runs-on: ubuntu-latest
timeout-minutes: 30
# Same reasoning as ci.yml: skip the pure dev -> main promotion, since this
# exact code was already scanned on the way into dev. Direct-to-main PRs
# (e.g. hotfixes) and the weekly schedule still run.
if: >-
!(github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.ref == 'dev')

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: actions
config-file: ./.github/codeql/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:actions"
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ on:

concurrency:
group: release-${{ github.workflow }}
cancel-in-progress: false

cancel-in-progress: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we should enable cancel-in-progress for the release workflow. Since this workflow publishes the release, cancelling an in-progress run could leave a release partially published. I'd keep cancel-in-progress: false here.

permissions:
contents: write
packages: write
Expand Down
Loading