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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,14 @@ jobs:
needs: changes
if: needs.changes.outputs.platform == 'true'
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
persist-credentials: false
submodules: false

Expand All @@ -214,6 +218,28 @@ jobs:
--all-features
--fail-under-lines 80

- name: Export platform coverage
run: |
set -euo pipefail
coverage_dir="target/platform-coverage"
mkdir -p "${coverage_dir}"
cargo llvm-cov report --locked \
-p registry-config-report \
-p 'registry-platform-*' \
--lcov \
--output-path "${coverage_dir}/platform.lcov"

- name: Upload platform coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
disable_search: true
fail_ci_if_error: false
files: target/platform-coverage/platform.lcov
flags: platform
name: platform
use_oidc: true
version: v11.3.1

platform-hygiene:
name: Platform hygiene and config inventory
needs: changes
Expand Down
81 changes: 80 additions & 1 deletion .github/workflows/notary-postgres-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ env:
jobs:
state-plane:
name: Notary state plane (PostgreSQL ${{ matrix.postgresql }})
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
Expand All @@ -76,12 +77,79 @@ jobs:
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
persist-credentials: false
submodules: false

- name: Cache Cargo registry and build artifacts
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
key: notary-postgresql-${{ matrix.postgresql }}
key: notary-postgresql-pr-${{ matrix.postgresql }}

- name: Build Registry Notary with CEL support
run: cargo build --locked -p registry-notary --features registry-notary-cel

- name: Precompile PostgreSQL conformance tests before service startup
run: cargo test --locked -p registry-notary-server --lib --no-run

- name: Run Notary PostgreSQL conformance
env:
NOTARY_BIN: target/notary-postgres-conformance/debug/registry-notary
NOTARY_POSTGRES_SOURCE_IMAGE: ${{ matrix.source_image }}
NOTARY_POSTGRES_TARGET_IMAGE: ${{ matrix.target_image }}
run: |
set -euo pipefail
diagnostics="${RUNNER_TEMP}/notary-postgresql-${{ matrix.postgresql }}-docker-events.log"
docker events --format '{{json .}}' >"${diagnostics}" &
events_pid=$!
trap 'kill "${events_pid}" 2>/dev/null || true; wait "${events_pid}" 2>/dev/null || true' EXIT
products/notary/scripts/postgresql-conformance.sh "${{ matrix.postgresql }}"

- name: Report PostgreSQL Docker diagnostics
if: failure()
run: |
set -euo pipefail
diagnostics="${RUNNER_TEMP}/notary-postgresql-${{ matrix.postgresql }}-docker-events.log"
if [[ -s "${diagnostics}" ]]; then
sed -n '1,400p' "${diagnostics}"
else
echo "No Docker events were captured."
fi
docker ps --all --no-trunc
docker version

state-plane-coverage:
name: Notary state plane (PostgreSQL ${{ matrix.postgresql }})
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
include:
- postgresql: "16"
source_image: postgres:16.13-alpine
target_image: postgres:16.14-alpine
- postgresql: "17"
source_image: postgres:17.9-alpine
target_image: postgres:17.10-alpine
- postgresql: "18"
source_image: postgres:18.3-alpine
target_image: postgres:18.4-alpine
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
persist-credentials: false
submodules: false

- name: Cache Cargo registry and build artifacts
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
key: notary-postgresql-coverage-${{ matrix.postgresql }}
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Install pinned coverage tool
Expand Down Expand Up @@ -138,6 +206,17 @@ jobs:
path: target/notary-postgres-conformance/coverage/
if-no-files-found: error

- name: Upload Notary PostgreSQL coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
disable_search: true
fail_ci_if_error: false
files: target/notary-postgres-conformance/coverage/notary-postgresql-${{ matrix.postgresql }}.lcov
flags: notary-postgres
name: notary-postgresql-${{ matrix.postgresql }}
use_oidc: true
version: v11.3.1

- name: Report PostgreSQL Docker diagnostics
if: failure()
run: |
Expand Down
42 changes: 42 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
coverage:
Comment thread
jeremi marked this conversation as resolved.
Comment thread
jeremi marked this conversation as resolved.
status:
default_rules:
flag_coverage_not_uploaded_behavior: exclude
project:
default: off
platform:
flags:
- platform
informational: true
notary-postgres:
flags:
- notary-postgres
informational: true
patch:
default: off
platform:
flags:
- platform
informational: true
notary-postgres:
flags:
- notary-postgres
informational: true

flags:
platform:
paths:
- "crates/registry-config-report/"
- "crates/registry-platform-*/**"
carryforward: true
notary-postgres:
paths:
- "crates/registry-notary/"
- "crates/registry-notary-server/"
carryforward: true

comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: true
show_carryforward_flags: true
Loading