...

Text file src/github.com/ProtonMail/go-crypto/.github/workflows/interop-test-suite.yml

Documentation: github.com/ProtonMail/go-crypto/.github/workflows

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

View as plain text