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

# Gate for pull requests. Because App-authored automation PRs (see
# update-emela-pin.yml) trigger this like any human PR, it doubles as the
# required check that guards auto-merge of the emela version bumps.
on:
pull_request:
workflow_dispatch:

permissions:
contents: read

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

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest # x86_64-linux
- os: macos-latest # aarch64-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main

# Evaluate every flake output (catches eval breakage), but do not build
# the heavy source package here.
- name: flake check (eval only)
run: nix flake check --no-build --show-trace

# The payload check for a version bump: actually fetch and unpack the
# pinned release binary, verifying the sha256 recorded in versions.json.
- name: build pinned emela binary
run: nix build .#emela --print-build-logs

# Single, stable status check to require in branch protection. Green only
# when every matrix build above succeeded (a skipped/failed matrix leg fails
# this job, so branch protection cannot be satisfied by a partial run).
ci:
needs: build
if: always()
runs-on: ubuntu-latest
steps:
- name: verify matrix result
run: |
if [ "${{ needs.build.result }}" != "success" ]; then
echo "one or more build jobs did not succeed: ${{ needs.build.result }}"
exit 1
fi
11 changes: 11 additions & 0 deletions .github/workflows/update-emela-pin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Open pull request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.app-token.outputs.token || github.token }}
Expand All @@ -72,3 +73,13 @@ jobs:
branch: automation/emela-update
delete-branch: true
labels: automation

# Queue the PR for auto-merge; GitHub merges it once the required `ci`
# check passes. This only works because the PR is App-authored above:
# a GITHUB_TOKEN-authored PR does not trigger the `ci` workflow, so the
# required check would never appear and auto-merge would hang forever.
- name: Enable auto-merge
if: steps.cpr.outputs.pull-request-number != ''
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
Loading