Skip to content

Commit 112e565

Browse files
committed
PR(CI): Use Vera image for document ACP workflow
1 parent 94bd4b7 commit 112e565

3 files changed

Lines changed: 55 additions & 53 deletions

File tree

.github/composites/get-sourcehub-image/action.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2026 Democratized Data Foundation
2+
#
3+
# Use of this software is governed by the Business Source License
4+
# included in the file licenses/BSL.txt.
5+
#
6+
# As of the Change Date specified in that file, in accordance with
7+
# the Business Source License, use of this software will be governed
8+
# by the Apache License, Version 2.0, included in the file
9+
# licenses/APL.txt.
10+
11+
name: 'Get Vera Docker Image Tag'
12+
13+
description: 'Composite action to determine the Vera Docker image matching go.mod'
14+
15+
outputs:
16+
image:
17+
description: "Vera image to use"
18+
value: ${{ steps.image-name.outputs.image }}
19+
20+
runs:
21+
# This is a composite action, setting this is required.
22+
using: "composite"
23+
24+
steps:
25+
# Go pseudo-versions contain the short commit for the required Vera revision.
26+
- name: Get Vera short commit
27+
id: vera-commit
28+
shell: bash
29+
run: |
30+
set -euo pipefail
31+
VERA_COMMIT=$(sed -En \
32+
's|^[[:space:]]*github.com/sourcenetwork/vera[[:space:]]+v[^[:space:]]+-([0-9a-f]+)[[:space:]]*$|\1|p' \
33+
go.mod)
34+
test -n "$VERA_COMMIT"
35+
echo "short=$VERA_COMMIT" >> "$GITHUB_OUTPUT"
36+
37+
# Fetch Vera to resolve the short pseudo-version commit to its full SHA.
38+
- name: Checkout Vera code into the directory
39+
uses: actions/checkout@v6
40+
with:
41+
repository: sourcenetwork/vera
42+
path: _vera
43+
fetch-depth: 0
44+
45+
- name: Build Vera image name
46+
id: image-name
47+
working-directory: _vera
48+
shell: bash
49+
run: |
50+
commit=$(git rev-parse "${{ steps.vera-commit.outputs.short }}^{commit}")
51+
echo "image=ghcr.io/sourcenetwork/vera:sha-$commit" >> "$GITHUB_OUTPUT"

.github/workflows/test-coverage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ jobs:
158158
- name: Setup defradb
159159
uses: ./.github/composites/setup-defradb
160160

161-
- name: Get SourceHub Docker Image Name
162-
id: sourcehub-image
163-
uses: ./.github/composites/get-sourcehub-image
161+
- name: Get Vera Docker Image Name
162+
id: vera-image
163+
uses: ./.github/composites/get-vera-image
164164

165165
- name: Test coverage & save coverage report in an artifact
166166
uses: ./.github/composites/test-coverage-with-artifact
167167
env:
168-
DEFRA_SOURCEHUB_IMAGE: ${{ steps.sourcehub-image.outputs.image }}
168+
DEFRA_SOURCEHUB_IMAGE: ${{ steps.vera-image.outputs.image }}
169169
with:
170170
coverage-artifact-name: "coverage_document_acp\
171171
_${{ matrix.document-acp-type }}\

0 commit comments

Comments
 (0)