Skip to content

Commit f60acf6

Browse files
authored
Update CI to compare v1 and v2 API in the interoperability test suite (#195)
Updates the CI to compare the v1 and v2 API from the branch against the v1 and v2 API on main instead of just v1 on main.
1 parent 4deafc1 commit f60acf6

File tree

4 files changed

+58
-21
lines changed

4 files changed

+58
-21
lines changed

.github/test-suite/build_gosop.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cd gosop
22
echo "replace github.com/ProtonMail/go-crypto => ../go-crypto" >> go.mod
33
go get github.com/ProtonMail/go-crypto
4-
go get github.com/ProtonMail/gopenpgp/v3/crypto@8acccb3915b46d8765d536ff9669bb61ec567f77
4+
go get github.com/ProtonMail/gopenpgp/v3/crypto@80762a9ce60ba09d8a0d4f7b2a9a9665e7716351
55
go build .

.github/test-suite/config.json.template

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
"path": "__GOSOP_BRANCH_V2__"
1010
},
1111
{
12-
"id": "gosop-main",
13-
"path": "__GOSOP_MAIN__"
12+
"id": "gosop-main-v1",
13+
"path": "__GOSOP_MAIN_V1__"
14+
},
15+
{
16+
"id": "gosop-main-v2",
17+
"path": "__GOSOP_MAIN_V2__"
1418
},
1519
{
1620
"path": "__SQOP__"

.github/test-suite/prepare_config.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ CONFIG_TEMPLATE=$1
22
CONFIG_OUTPUT=$2
33
GOSOP_BRANCH_V1=$3
44
GOSOP_BRANCH_V2=$4
5-
GOSOP_MAIN=$5
5+
GOSOP_MAIN_V1=$5
6+
GOSOP_MAIN_V2=$6
67
cat $CONFIG_TEMPLATE \
78
| sed "s@__GOSOP_BRANCH_V1__@${GOSOP_BRANCH_V1}@g" \
89
| sed "s@__GOSOP_BRANCH_V2__@${GOSOP_BRANCH_V2}@g" \
9-
| sed "s@__GOSOP_MAIN__@${GOSOP_MAIN}@g" \
10+
| sed "s@__GOSOP_MAIN_V1__@${GOSOP_MAIN_V1}@g" \
11+
| sed "s@__GOSOP_MAIN_V2__@${GOSOP_MAIN_V2}@g" \
1012
| sed "s@__SQOP__@${SQOP}@g" \
1113
| sed "s@__GPGME_SOP__@${GPGME_SOP}@g" \
1214
| sed "s@__SOP_OPENPGPJS__@${SOP_OPENPGPJS}@g" \

.github/workflows/interop-test-suite.yml

+47-16
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
name: gosop-${{ github.sha }}-v2
4242
path: ./gosop-${{ github.sha }}-v2
4343

44-
build-gosop-main:
45-
name: Build gosop from main
44+
build-gosop-main-v1:
45+
name: Build gosop from main v1-api
4646
runs-on: ubuntu-latest
4747
steps:
4848
- name: Checkout
@@ -51,13 +51,33 @@ jobs:
5151
uses: ./.github/actions/build-gosop
5252
with:
5353
go-crypto-ref: main
54-
binary-location: ./gosop-main
54+
binary-location: ./gosop-main-v1
5555
# Upload as artifact
5656
- name: Upload gosop-main artifact
5757
uses: actions/upload-artifact@v3
5858
with:
59-
name: gosop-main
60-
path: ./gosop-main
59+
name: gosop-main-v1
60+
path: ./gosop-main-v1
61+
62+
build-gosop-main-v2:
63+
name: Build gosop from main v2-api
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v3
68+
- name: Build gosop from branch
69+
uses: ./.github/actions/build-gosop
70+
with:
71+
go-crypto-ref: main
72+
binary-location: ./gosop-main-v2
73+
branch-gosop: gosop-gopenpgp-v3
74+
gosop-build-path: build_gosop.sh
75+
# Upload as artifact
76+
- name: Upload gosop-main artifact
77+
uses: actions/upload-artifact@v3
78+
with:
79+
name: gosop-main-v2
80+
path: ./gosop-main-v2
6181

6282
test-suite:
6383
name: Run interoperability test suite
@@ -70,20 +90,31 @@ jobs:
7090
needs:
7191
- build-gosop-v1
7292
- build-gosop-v2
73-
- build-gosop-main
93+
- build-gosop-main-v1
94+
- build-gosop-main-v2
7495
steps:
7596
- name: Checkout
7697
uses: actions/checkout@v3
77-
# Fetch gosop from main
78-
- name: Download gosop-main
98+
# Fetch gosop from main v1
99+
- name: Download gosop-main-v1
100+
uses: actions/download-artifact@v3
101+
with:
102+
name: gosop-main-v1
103+
# Test gosop-main-v1
104+
- name: Make gosop-main executable
105+
run: chmod +x gosop-main-v1
106+
- name: Print gosop-main-v1 version
107+
run: ./gosop-main-v1 version --extended
108+
# Fetch gosop from main v2
109+
- name: Download gosop-main-v2
79110
uses: actions/download-artifact@v3
80111
with:
81-
name: gosop-main
82-
# Test gosop-main
112+
name: gosop-main-v2
113+
# Test gosop-main-v2
83114
- name: Make gosop-main executable
84-
run: chmod +x gosop-main
85-
- name: Print gosop-main version
86-
run: ./gosop-main version --extended
115+
run: chmod +x gosop-main-v2
116+
- name: Print gosop-main-v2 version
117+
run: ./gosop-main-v2 version --extended
87118
# Fetch gosop from branch v1
88119
- name: Download gosop-branch-v1
89120
uses: actions/download-artifact@v3
@@ -110,7 +141,7 @@ jobs:
110141
run: ./gosop-branch-v2 version --extended
111142
# Run test suite
112143
- name: Prepare test configuration
113-
run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch-v1 $GITHUB_WORKSPACE/gosop-branch-v2 $GITHUB_WORKSPACE/gosop-main
144+
run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch-v1 $GITHUB_WORKSPACE/gosop-branch-v2 $GITHUB_WORKSPACE/gosop-main-v1 $GITHUB_WORKSPACE/gosop-main-v2
114145
env:
115146
CONFIG_TEMPLATE: .github/test-suite/config.json.template
116147
CONFIG_OUTPUT: .github/test-suite/config.json
@@ -151,13 +182,13 @@ jobs:
151182
with:
152183
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json
153184
output: baseline-comparison-v1.json
154-
baseline: gosop-main
185+
baseline: gosop-main-v1
155186
target: gosop-branch-v1
156187
- name: Compare with baseline v2
157188
uses: ProtonMail/openpgp-interop-test-analyzer@5d7f4b6868ebe3bfc909302828342c461f5f4940
158189
with:
159190
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json
160191
output: baseline-comparison-v2.json
161-
baseline: gosop-main
192+
baseline: gosop-main-v2
162193
target: gosop-branch-v2
163194

0 commit comments

Comments
 (0)