Skip to content

Commit fc91400

Browse files
committed
ci: Interoptest-suite must compare to target
1 parent 835d4b8 commit fc91400

File tree

8 files changed

+32
-31
lines changed

8 files changed

+32
-31
lines changed

.github/test-suite/build_gosop.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
VERSION=$(awk '/^module github.com\/ProtonMail\/gopenpgp\/v[0-9]+/ {print $NF}' gopenpgp/go.mod | awk -F'v' '{print $2}')
2+
13
cd gosop
2-
echo "replace github.com/ProtonMail/gopenpgp/v3 => ../gopenpgp" >> go.mod
3-
go get github.com/ProtonMail/gopenpgp/v3/crypto
4+
echo "replace github.com/ProtonMail/gopenpgp/v${VERSION} => ../gopenpgp" >> go.mod
45
go build .

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"path": "__GOSOP_BRANCH__"
66
},
77
{
8-
"id": "gosop-main",
9-
"path": "__GOSOP_MAIN__"
8+
"id": "gosop-target",
9+
"path": "__GOSOP_TARGET__"
1010
},
1111
{
1212
"path": "__SQOP__"

.github/test-suite/determine_gosop_branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ if [ "$VERSION" -eq 3 ]; then
44
echo "gosop-gopenpgp-v3"
55
else
66
echo "main"
7-
fi
7+
fi

.github/test-suite/prepare_config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
CONFIG_TEMPLATE=$1
22
CONFIG_OUTPUT=$2
33
GOSOP_BRANCH=$3
4-
GOSOP_MAIN=$4
4+
GOSOP_TARGET=$4
55
cat $CONFIG_TEMPLATE \
66
| sed "s@__GOSOP_BRANCH__@${GOSOP_BRANCH}@g" \
7-
| sed "s@__GOSOP_MAIN__@${GOSOP_MAIN}@g" \
7+
| sed "s@__GOSOP_TARGET__@${GOSOP_TARGET}@g" \
88
| sed "s@__SQOP__@${SQOP}@g" \
99
| sed "s@__GPGME_SOP__@${GPGME_SOP}@g" \
1010
| sed "s@__SOP_OPENPGPJS__@${SOP_OPENPGPJS_V2}@g" \

.github/workflows/android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, v3 ]
88

99
jobs:
1010
build:

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, v3 ]
88

99
jobs:
1010
test:

.github/workflows/ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, v3 ]
88

99
jobs:
1010
build:

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: SOP interoperability test suite
22

33
on:
44
pull_request:
5-
branches: [ main ]
5+
branches: [ main, v3 ]
66

77
jobs:
88

@@ -23,23 +23,23 @@ jobs:
2323
name: gosop-${{ github.sha }}
2424
path: ./gosop-${{ github.sha }}
2525

26-
build-gosop-main:
27-
name: Build gosop from main
26+
build-gosop-target:
27+
name: Build gosop from target
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
3131
uses: actions/checkout@v3
3232
- name: Build gosop from branch
3333
uses: ./.github/actions/build-gosop
3434
with:
35-
gopenpgp-ref: main
36-
binary-location: ./gosop-main
35+
gopenpgp-ref: ${{ github.base_ref }}
36+
binary-location: ./gosop-target
3737
# Upload as artifact
38-
- name: Upload gosop-main artifact
38+
- name: Upload gosop-target artifact
3939
uses: actions/upload-artifact@v3
4040
with:
41-
name: gosop-main
42-
path: ./gosop-main
41+
name: gosop-target
42+
path: ./gosop-target
4343

4444

4545
test-suite:
@@ -52,20 +52,20 @@ jobs:
5252
password: ${{ secrets.github_token }}
5353
needs:
5454
- build-gosop
55-
- build-gosop-main
55+
- build-gosop-target
5656
steps:
5757
- name: Checkout
5858
uses: actions/checkout@v3
59-
# Fetch gosop from main
60-
- name: Download gosop-main
59+
# Fetch gosop from target
60+
- name: Download gosop-target
6161
uses: actions/download-artifact@v3
6262
with:
63-
name: gosop-main
64-
# Test gosop-main
65-
- name: Make gosop-main executable
66-
run: chmod +x gosop-main
67-
- name: Print gosop-main version
68-
run: ./gosop-main version --extended
63+
name: gosop-target
64+
# Test gosop-target
65+
- name: Make gosop-target executable
66+
run: chmod +x gosop-target
67+
- name: Print gosop-target version
68+
run: ./gosop-target version --extended
6969
# Fetch gosop from branch
7070
- name: Download gosop-branch
7171
uses: actions/download-artifact@v3
@@ -80,7 +80,7 @@ jobs:
8080
run: ./gosop-branch version --extended
8181
# Run test suite
8282
- name: Prepare test configuration
83-
run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch $GITHUB_WORKSPACE/gosop-main
83+
run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch $GITHUB_WORKSPACE/gosop-target
8484
env:
8585
CONFIG_TEMPLATE: .github/test-suite/config.json.template
8686
CONFIG_OUTPUT: .github/test-suite/config.json
@@ -104,8 +104,8 @@ jobs:
104104
name: test-suite-results.html
105105
path: .github/test-suite/test-suite-results.html
106106

107-
compare-with-main:
108-
name: Compare with main
107+
compare-with-target:
108+
name: Compare with target
109109
runs-on: ubuntu-latest
110110
needs: test-suite
111111
steps:
@@ -121,5 +121,5 @@ jobs:
121121
with:
122122
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json
123123
output: baseline-comparison.json
124-
baseline: gosop-main
124+
baseline: gosop-target
125125
target: gosop-branch

0 commit comments

Comments
 (0)