github.com/koko1123/flow-go-1@v0.29.6/.github/workflows/test-monitor-regular-skipped.yml (about)

     1  # This workflow
     2  # 1) runs all non-skipped (regular) tests and generates a summary.
     3  # 2) generates a report of all skipped tests (e.g. due to flakiness).
     4  
     5  name: Test Monitor - Regular and Skipped
     6  
     7  on:
     8    schedule:
     9      - cron: '0 */2 * * *' # every 2 hours
    10    push:
    11      paths:
    12        - 'tools/test_monitor/**'
    13  
    14  env:
    15    BIGQUERY_DATASET: production_src_flow_test_metrics
    16    BIGQUERY_TABLE: skipped_tests
    17    BIGQUERY_TABLE2: test_results
    18    GO_VERSION: 1.19
    19  
    20  concurrency: 
    21    group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
    22    cancel-in-progress: true
    23  
    24  jobs:
    25    regular-skipped-test-run:
    26      name: Test Monitor - Regular, Skipped Tests Run
    27      strategy:
    28        fail-fast: false
    29        matrix:
    30          test-category:
    31            - unit
    32            - unit-crypto
    33            - unit-insecure
    34            - unit-integration
    35            - integration-bft
    36            - integration-mvp
    37            - integration-ghost
    38            - integration-network
    39            - integration-epochs
    40            - integration-access
    41            - integration-collection
    42            - integration-consensus
    43            - integration-execution
    44            - integration-verification
    45      env:
    46        TEST_CATEGORY: ${{ matrix.test-category }}
    47        COMMIT_SHA: ${{ github.sha }}
    48        RUN_ID: ${{ github.run_id }}
    49        SKIPPED_TESTS_FILE: skipped-tests
    50        RESULTS_FILE: test-results
    51      runs-on: ubuntu-latest
    52      steps:
    53      - name: Get job run date
    54        id: job_run_date
    55        run: echo "::set-output name=date::$(TZ=":America/Los_Angeles" date -Iseconds)"
    56      - name: Set up Cloud SDK
    57        uses: google-github-actions/setup-gcloud@v0
    58        with:
    59          service_account_key: ${{ secrets.GCP_SA_KEY }}
    60      - name: Setup Go
    61        uses: actions/setup-go@v2
    62        with:
    63          go-version: ${{ env.GO_VERSION }}
    64      - name: Checkout repo
    65        uses: actions/checkout@v2
    66        with:
    67          ref: ${{ env.COMMIT_SHA }}
    68      - name: Get commit date
    69        id: commit_date
    70        run: echo "::set-output name=date::$(git show --no-patch --no-notes --pretty='%cI' $COMMIT_SHA)"
    71      - name: Run tests
    72        uses: nick-fields/retry@v2
    73        with:
    74          timeout_minutes: 60
    75          max_attempts: 5
    76          command: ./tools/test_monitor/run-tests.sh
    77        env:
    78          JSON_OUTPUT: true
    79      - name: Process test results
    80        run: cat test-output | go run tools/test_monitor/level1/process_summary1_results.go
    81        env:
    82          JOB_STARTED: ${{ steps.job_run_date.outputs.date }}
    83          COMMIT_DATE: ${{ steps.commit_date.outputs.date }}
    84      - name: Upload results to BigQuery (skipped tests)
    85        uses: nick-fields/retry@v2
    86        with:
    87          timeout_minutes: 1
    88          max_attempts: 3
    89          command: bq load --source_format=NEWLINE_DELIMITED_JSON $BIGQUERY_DATASET.$BIGQUERY_TABLE $SKIPPED_TESTS_FILE tools/test_monitor/schemas/skipped_tests_schema.json
    90      - name: Upload results to BigQuery (test run)
    91        uses: nick-fields/retry@v2
    92        with:
    93          timeout_minutes: 2
    94          max_attempts: 3
    95          command: bq load --source_format=NEWLINE_DELIMITED_JSON $BIGQUERY_DATASET.$BIGQUERY_TABLE2 $RESULTS_FILE tools/test_monitor/schemas/test_results_schema.json