| 1 |
name: SOP interoperability test suite |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
branches: [ main, v3 ] |
| 6 |
|
| 7 |
permissions: {} |
| 8 |
|
| 9 |
jobs: |
| 10 |
|
| 11 |
build-gosop: |
| 12 |
name: Build gosop from branch |
| 13 |
runs-on: ubuntu-latest |
| 14 |
steps: |
| 15 |
- name: Checkout |
| 16 |
uses: actions/checkout@v6 |
| 17 |
- name: Build gosop from branch |
| 18 |
uses: ./.github/actions/build-gosop |
| 19 |
with: |
| 20 |
binary-location: ./gosop-${{ github.sha }} |
| 21 |
# Upload as artifact |
| 22 |
- name: Upload gosop artifact |
| 23 |
uses: actions/upload-artifact@v7 |
| 24 |
with: |
| 25 |
name: gosop-${{ github.sha }} |
| 26 |
path: ./gosop-${{ github.sha }} |
| 27 |
|
| 28 |
build-gosop-target: |
| 29 |
name: Build gosop from target |
| 30 |
runs-on: ubuntu-latest |
| 31 |
steps: |
| 32 |
- name: Checkout |
| 33 |
uses: actions/checkout@v6 |
| 34 |
- name: Build gosop from branch |
| 35 |
uses: ./.github/actions/build-gosop |
| 36 |
with: |
| 37 |
gopenpgp-ref: ${{ github.base_ref }} |
| 38 |
binary-location: ./gosop-target |
| 39 |
# Upload as artifact |
| 40 |
- name: Upload gosop-target artifact |
| 41 |
uses: actions/upload-artifact@v7 |
| 42 |
with: |
| 43 |
name: gosop-target |
| 44 |
path: ./gosop-target |
| 45 |
|
| 46 |
|
| 47 |
test-suite: |
| 48 |
name: Run interoperability test suite |
| 49 |
runs-on: ubuntu-latest |
| 50 |
container: |
| 51 |
image: ghcr.io/protonmail/openpgp-interop-test-docker:v1.1.12 |
| 52 |
credentials: |
| 53 |
username: ${{ github.actor }} |
| 54 |
password: ${{ secrets.github_token }} |
| 55 |
needs: |
| 56 |
- build-gosop |
| 57 |
- build-gosop-target |
| 58 |
steps: |
| 59 |
- name: Checkout |
| 60 |
uses: actions/checkout@v6 |
| 61 |
# Fetch gosop from target |
| 62 |
- name: Download gosop-target |
| 63 |
uses: actions/download-artifact@v4 |
| 64 |
with: |
| 65 |
name: gosop-target |
| 66 |
# Test gosop-target |
| 67 |
- name: Make gosop-target executable |
| 68 |
run: chmod +x gosop-target |
| 69 |
- name: Print gosop-target version |
| 70 |
run: ./gosop-target version --extended |
| 71 |
# Fetch gosop from branch |
| 72 |
- name: Download gosop-branch |
| 73 |
uses: actions/download-artifact@v4 |
| 74 |
with: |
| 75 |
name: gosop-${{ github.sha }} |
| 76 |
- name: Rename gosop-branch |
| 77 |
run: mv gosop-${{ github.sha }} gosop-branch |
| 78 |
# Test gosop-branch |
| 79 |
- name: Make gosop-branch executable |
| 80 |
run: chmod +x gosop-branch |
| 81 |
- name: Print gosop-branch version |
| 82 |
run: ./gosop-branch version --extended |
| 83 |
# Run test suite |
| 84 |
- name: Prepare test configuration |
| 85 |
run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch $GITHUB_WORKSPACE/gosop-target |
| 86 |
env: |
| 87 |
CONFIG_TEMPLATE: .github/test-suite/config.json.template |
| 88 |
CONFIG_OUTPUT: .github/test-suite/config.json |
| 89 |
- name: Display configuration |
| 90 |
run: cat .github/test-suite/config.json |
| 91 |
- name: Run interoperability test suite |
| 92 |
run: cd $TEST_SUITE_DIR && $TEST_SUITE --config $GITHUB_WORKSPACE/$CONFIG --json-out $GITHUB_WORKSPACE/$RESULTS_JSON --html-out $GITHUB_WORKSPACE/$RESULTS_HTML |
| 93 |
env: |
| 94 |
CONFIG: .github/test-suite/config.json |
| 95 |
RESULTS_JSON: .github/test-suite/test-suite-results.json |
| 96 |
RESULTS_HTML: .github/test-suite/test-suite-results.html |
| 97 |
# Upload results |
| 98 |
- name: Upload test results json artifact |
| 99 |
uses: actions/upload-artifact@v7 |
| 100 |
with: |
| 101 |
name: test-suite-results.json |
| 102 |
path: .github/test-suite/test-suite-results.json |
| 103 |
- name: Upload test results html artifact |
| 104 |
uses: actions/upload-artifact@v7 |
| 105 |
with: |
| 106 |
name: test-suite-results.html |
| 107 |
path: .github/test-suite/test-suite-results.html |
| 108 |
|
| 109 |
compare-with-target: |
| 110 |
name: Compare with target |
| 111 |
runs-on: ubuntu-latest |
| 112 |
needs: test-suite |
| 113 |
steps: |
| 114 |
- name: Checkout |
| 115 |
uses: actions/checkout@v6 |
| 116 |
- name: Download test results json artifact |
| 117 |
id: download-test-results |
| 118 |
uses: actions/download-artifact@v4 |
| 119 |
with: |
| 120 |
name: test-suite-results.json |
| 121 |
- name: Compare with baseline |
| 122 |
uses: ProtonMail/[email protected] |
| 123 |
with: |
| 124 |
results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json |
| 125 |
output: baseline-comparison.json |
| 126 |
baseline: gosop-target |
| 127 |
target: gosop-branch |