rubyforgood/casa

View on GitHub
.github/workflows/combine_and_report.yml

Summary

Maintainability
Test Coverage
on:
  workflow_call:
jobs:
  combine_and_report:
    runs-on: ubuntu-latest
    env:
      AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
      AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
      STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
    steps:
      - name: Checkout Project
        if: ${{ !cancelled() }}
        uses: actions/checkout@v4
      - name: Download artifacts
        if: ${{ !cancelled() }}
        uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Decompress chunk test reports
        if: ${{ !cancelled() }}
        run: |
          find artifacts -name "test_reports*.zip" -exec unzip -d test_reports {} \;
          find test_reports -name "**/test_reports*.zip" -exec unzip -d test_reports {} \;

      - name: Merge parallel runtime log parts
        if: ${{ !cancelled() && env.AZURE_STORAGE_KEY != '' }}
        run: |
          cat artifacts/**/parallel_runtime_rspec*.log > parallel_runtime.log

      - name: Upload log file to Azure Blob Storage
        if: ${{ !cancelled() && env.AZURE_STORAGE_KEY != '' }}
        run: |
          az storage blob upload \
          -c $STORAGE_CONTAINER \
          --file parallel_runtime.log \
          -n parallel_runtime.log \
          --overwrite true

      - name: Test Summary
        id: test_summary
        uses: test-summary/action@v2
        with:
          paths: |
            test_reports/**/rspec*.xml
      - name: Set job status
        if: ${{ steps.test_summary.outputs.failed > 0 }}
        uses: actions/github-script@v7
        with:
          script: |
            core.setFailed('There are test failures')