aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/linux-wpt.yml
blob: 34857bdc9d0c10137dda73572769f6c08890458a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Linux WPT Tests
on:
  workflow_call:
    inputs:
      profile:
        required: true
        type: string
      wpt-args:
        default: ""
        required: false
        type: string
      wpt-sync-from-upstream:
        default: false
        required: false
        type: boolean
      wpt-layout:
        required: true
        type: string

env:
  RUST_BACKTRACE: 1
  SHELL: /bin/bash
  GST_PLUGIN_FEATURE_RANK: pulsesink:NONE,alsasink:NONE,jacksink:NONE,fakesink:MAX
  INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ !inputs.wpt-sync-from-upstream && secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET || '' }}
  INTERMITTENT_TRACKER_DASHBOARD_SECRET_PROD: ${{ !inputs.wpt-sync-from-upstream && secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET_PROD || '' }}
  INTERMITTENT_TRACKER_DASHBOARD_SECRET_STAGING: ${{ !inputs.wpt-sync-from-upstream && secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET_STAGING || '' }}
  WPT_LAYOUT_ARG: "${{ inputs.wpt-layout == 'layout-2013' && '--legacy-layout' || '' }}"
  WPT_ALWAYS_SUCCEED_ARG: "${{ inputs.wpt-sync-from-upstream && '--always-succeed' || '' }}"

jobs:
  linux-wpt:
    name: WPT ${{ inputs.wpt-layout }}
    runs-on: ubuntu-22.04
    env:
      max_chunk_id: 20
    strategy:
      fail-fast: false
      matrix:
        chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
    steps:
      - uses: actions/checkout@v4
        if: github.event_name != 'pull_request_target'
      # This is necessary to checkout the pull request if this run was triggered via a
      # `pull_request_target` event.
      - uses: actions/checkout@v4
        if: github.event_name == 'pull_request_target'
        with:
          ref: refs/pull/${{ github.event.number }}/head
      - uses: actions/download-artifact@v4
        with:
          name: ${{ inputs.profile }}-binary-linux
          path: ${{ inputs.profile }}-binary-linux
      - name: unPackage binary
        run: tar -xzf ${{ inputs.profile }}-binary-linux/target.tar.gz
      - name: Bootstrap dependencies
        run: |
          python3 -m pip install --upgrade pip
          sudo apt update
          sudo apt install -qy --no-install-recommends mesa-vulkan-drivers
          python3 ./mach bootstrap --skip-lints
      - name: Sync from upstream WPT
        if: ${{ inputs.wpt-sync-from-upstream }}
        run: |
          ./mach update-wpt --sync --patch
      - name: Run tests
        run: |
          mkdir -p wpt-filtered-logs/linux-${{ inputs.wpt-layout }}
          mkdir -p wpt-full-logs/linux-${{ inputs.wpt-layout }}
          python3 ./mach test-wpt \
            $WPT_LAYOUT_ARG \
            $WPT_ALWAYS_SUCCEED_ARG \
            --${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
            --total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
            --log-raw wpt-full-logs/linux-${{ inputs.wpt-layout }}/raw/${{ matrix.chunk_id }}.log \
            --log-wptreport wpt-full-logs/linux-${{ inputs.wpt-layout }}/wptreport/${{ matrix.chunk_id }}.json \
            --log-raw-unexpected wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
            --filter-intermittents wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.json \
            ${{ inputs.wpt-args }}
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
      - name: Archive results (filtered)
        uses: actions/upload-artifact@v4
        if: ${{ always() }}
        with:
          name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}-${{ matrix.chunk_id }}
          path: wpt-filtered-logs/*/
      - name: Archive results (full)
        uses: actions/upload-artifact@v4
        if: ${{ always() }}
        with:
          name: wpt-full-logs-linux-${{ inputs.wpt-layout }}-${{ matrix.chunk_id }}
          path: wpt-full-logs/*/

  report-test-results:
    name: Process WPT Results
    runs-on: ubuntu-latest
    if: ${{ always() }}
    needs: linux-wpt
    steps:
      - name: Merge logs (full)
        uses: actions/upload-artifact/merge@v4
        with:
          name: wpt-full-logs-linux-${{ inputs.wpt-layout }}
          pattern: wpt-full-logs-linux-${{ inputs.wpt-layout }}-*
          delete-merged: true
      # This job needs to be last. If no filtered results were uploaded, it will fail, but we want to merge other archives in that case.
      - name: Merge logs (filtered)
        uses: actions/upload-artifact/merge@v4
        with:
          name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
          pattern: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}-*
          delete-merged: true
      - uses: actions/checkout@v4
        if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
      - uses: actions/download-artifact@v4
        if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
        with:
          name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
          path: results
      - name: Report results
        if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
        run: |
          etc/ci/report_aggregated_expected_results.py \
            --tag="linux-wpt-${{ inputs.wpt-layout }}" \
            results/linux-${{ inputs.wpt-layout }}/*.json
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          RESULTS: ${{ toJson(needs.*.result) }}