| 1 |
name: SOP interoperability test suite |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
branches: [ main ] |
| 6 |
|
| 7 |
jobs: |
| 8 |
build-gosop-v1: |
| 9 |
name: Build gosop from branch v1-api |
| 10 |
runs-on: ubuntu-latest |
| 11 |
steps: |
| 12 |
- name: Checkout |
| 13 |
uses: actions/checkout@v3 |
| 14 |
- name: Build gosop from branch |
| 15 |
uses: ./.github/actions/build-gosop |
| 16 |
with: |
| 17 |
binary-location: ./gosop-${{ github.sha }}-v1 |
| 18 |
branch-gosop: gosop-gopenpgp-v2 |
| 19 |
# Upload as artifact |
| 20 |
- name: Upload gosop artifact |
| 21 |
uses: actions/upload-artifact@v4 |
| 22 |
with: |
| 23 |
name: gosop-${{ github.sha }}-v1 |
| 24 |
path: ./gosop-${{ github.sha }}-v1 |
| 25 |
|
| 26 |
build-gosop-v2: |
| 27 |
name: Build gosop from branch v2-api |
| 28 |
runs-on: ubuntu-latest |
| 29 |
steps: |
| 30 |
- name: Checkout |
| 31 |
uses: actions/checkout@v3 |
| 32 |
- name: Build gosop from branch |
| 33 |
uses: ./.github/actions/build-gosop |
| 34 |
with: |
| 35 |
binary-location: ./gosop-${{ github.sha }}-v2 |
| 36 |
branch-gosop: gosop-gopenpgp-v3 |
| 37 |
gosop-build-path: build_gosop.sh |
| 38 |
# Upload as artifact |
| 39 |
- name: Upload gosop artifact |
| 40 |
uses: actions/upload-artifact@v4 |
| 41 |
with: |
| 42 |
name: gosop-${{ github.sha }}-v2 |
| 43 |
path: ./gosop-${{ github.sha }}-v2 |
| 44 |
|
| 45 |
build-gosop-main-v1: |
| 46 |
name: Build gosop from main v1-api |
| 47 |
runs-on: ubuntu-latest |
| 48 |
steps: |
| 49 |
- name: Checkout |
| 50 |
uses: actions/checkout@v3 |
| 51 |
- name: Build gosop from branch |
| 52 |
uses: ./.github/actions/build-gosop |
| 53 |
with: |
| 54 |
go-crypto-ref: main |
| 55 |
branch-gosop: gosop-gopenpgp-v2 |
| 56 |
binary-location: ./gosop-main-v1 |
| 57 |
# Upload as artifact |
| 58 |
- name: Upload gosop-main artifact |
| 59 |
uses: actions/upload-artifact@v4 |
| 60 |
with: |
| 61 |
name: gosop-main-v1 |
| 62 |
path: ./gosop-main-v1 |
| 63 |
|
| 64 |
build-gosop-main-v2: |
| 65 |
name: Build gosop from main v2-api |
| 66 |
runs-on: ubuntu-latest |
| 67 |
steps: |
| 68 |
- name: Checkout |
| 69 |
uses: actions/checkout@v3 |
| 70 |
- name: Build gosop from branch |
| 71 |
uses: ./.github/actions/build-gosop |
| 72 |
with: |
| 73 |
go-crypto-ref: main |
| 74 |
binary-location: ./gosop-main-v2 |
| 75 |
branch-gosop: gosop-gopenpgp-v3 |
| 76 |
gosop-build-path: build_gosop.sh |
| 77 |
# Upload as artifact |
| 78 |
- name: Upload gosop-main artifact |
| 79 |
uses: actions/upload-artifact@v4 |
| 80 |
with: |
| 81 |
name: gosop-main-v2 |
| 82 |
path: ./gosop-main-v2 |
| 83 |
|
| 84 |
test-suite: |
| 85 |
name: Run interoperability test suite |
| 86 |
runs-on: ubuntu-latest |
| 87 |
container: |
| 88 |
image: ghcr.io/protonmail/openpgp-interop-test-docker:v1.1.9 |
| 89 |
credentials: |
| 90 |
username: ${{ github.actor }} |
| 91 |
password: ${{ secrets.github_token }} |
| 92 |
needs: |
| 93 |
- build-gosop-v1 |
| 94 |
- build-gosop-v2 |
| 95 |
- build-gosop-main-v1 |
| 96 |
- build-gosop-main-v2 |
| 97 |
steps: |
| 98 |
- name: Checkout |
| 99 |
uses: actions/checkout@v3 |
| 100 |
# Fetch gosop from main v1 |
| 101 |
- name: Download gosop-main-v1 |
| 102 |
uses: actions/download-artifact@v4 |
| 103 |
with: |
| 104 |
name: gosop-main-v1 |
| 105 |
# Test gosop-main-v1 |
| 106 |
- name: Make gosop-main executable |
| 107 |
run: chmod +x gosop-main-v1 |
| 108 |
- name: Print gosop-main-v1 version |
| 109 |
run: ./gosop-main-v1 version --extended |
| 110 |
# Fetch gosop from main v2 |
| 111 |
- name: Download gosop-main-v2 |
| 112 |
uses: actions/download-artifact@v4 |
| 113 |
with: |
| 114 |
name: gosop-main-v2 |
| 115 |
# Test gosop-main-v2 |
| 116 |
- name: Make gosop-main executable |
| 117 |
run: chmod +x gosop-main-v2 |
| 118 |
- name: Print gosop-main-v2 version |
| 119 |
run: ./gosop-main-v2 version --extended |
| 120 |
# Fetch gosop from branch v1 |
| 121 |
- name: Download gosop-branch-v1 |
| 122 |
uses: actions/download-artifact@v4 |
| 123 |
with: |
| 124 |
name: gosop-${{ github.sha }}-v1 |
| 125 |
- name: Rename gosop-branch-v1 |
| 126 |
run: mv gosop-${{ github.sha }}-v1 gosop-branch-v1 |
| 127 |
# Test gosop-branch v1 |
| 128 |
- name: Make gosop-branch-v1 executable |
| 129 |
run: chmod +x gosop-branch-v1 |
| 130 |
- name: Print gosop-branch-v1 version |
| 131 |
run: ./gosop-branch-v1 version --extended |
| 132 |
# Fetch gosop from branch v2 |
| 133 |
- name: Download gosop-branch-v2 |
| 134 |
uses: actions/download-artifact@v4 |
| 135 |
with: |
| 136 |
name: gosop-${{ github.sha }}-v2 |
| 137 |
- name: Rename gosop-branch-v2 |
| 138 |
run: mv gosop-${{ github.sha }}-v2 gosop-branch-v2 |
| 139 |
# Test gosop-branch v2 |
| 140 |
- name: Make gosop-branch-v2 executable |
| 141 |
run: chmod +x gosop-branch-v2 |
| 142 |
- name: Print gosop-branch-v2 version |
| 143 |
run: ./gosop-branch-v2 version --extended |
| 144 |
# Run test suite |
| 145 |
- name: Prepare test configuration |
| 146 |
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 |
| 147 |
env: |
| 148 |
CONFIG_TEMPLATE: .github/test-suite/config.json.template |
| 149 |
CONFIG_OUTPUT: .github/test-suite/config.json |
| 150 |
- name: Display configuration |
| 151 |
run: cat .github/test-suite/config.json |
| 152 |
- name: Run interoperability test suite |
| 153 |
run: cd $TEST_SUITE_DIR && $TEST_SUITE --config $GITHUB_WORKSPACE/$CONFIG --json-out $GITHUB_WORKSPACE/$RESULTS_JSON --html-out $GITHUB_WORKSPACE/$RESULTS_HTML |
| 154 |
env: |
| 155 |
CONFIG: .github/test-suite/config.json |
| 156 |
RESULTS_JSON: .github/test-suite/test-suite-results.json |
| 157 |
RESULTS_HTML: .github/test-suite/test-suite-results.html |
| 158 |
# Upload results |
| 159 |
- name: Upload test results json artifact |
| 160 |
uses: actions/upload-artifact@v4 |
| 161 |
with: |
| 162 |
name: test-suite-results.json |
| 163 |
path: .github/test-suite/test-suite-results.json |
| 164 |
- name: Upload test results html artifact |
| 165 |
uses: actions/upload-artifact@v4 |
| 166 |
with: |
| 167 |
name: test-suite-results.html |
| 168 |
path: .github/test-suite/test-suite-results.html |
| 169 |
|
| 170 |
compare-with-main: |
| 171 |
name: Compare with main |
| 172 |
runs-on: ubuntu-latest |
| 173 |
needs: test-suite |
| 174 |
steps: |
| 175 |
- name: Checkout |
| 176 |
uses: actions/checkout@v3 |
| 177 |
- name: Download test results json artifact |
| 178 |
id: download-test-results |
| 179 |
uses: actions/download-artifact@v4 |
| 180 |
with: |
| 181 |
name: test-suite-results.json |
| 182 |
- name: Compare with baseline v1 |
| 183 |
uses: ProtonMail/[email protected] |
| 184 |
with: |
| 185 |
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json |
| 186 |
output: baseline-comparison-v1.json |
| 187 |
baseline: gosop-main-v1 |
| 188 |
target: gosop-branch-v1 |
| 189 |
- name: Compare with baseline v2 |
| 190 |
uses: ProtonMail/[email protected] |
| 191 |
with: |
| 192 |
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json |
| 193 |
output: baseline-comparison-v2.json |
| 194 |
baseline: gosop-main-v2 |
| 195 |
target: gosop-branch-v2 |
| 196 |
|