|
27 | 27 | smoke-tests: |
28 | 28 | runs-on: ubuntu-latest |
29 | 29 | timeout-minutes: 60 |
30 | | - strategy: |
31 | | - fail-fast: false |
32 | | - matrix: |
33 | | - shard: [1, 2, 3, 4] |
34 | 30 | steps: |
35 | 31 | - name: Checkout |
36 | 32 | uses: runloopai/checkout@main |
|
41 | 37 | uses: runloopai/setup-node@main |
42 | 38 | with: |
43 | 39 | node-version: '20' |
| 40 | + cache: yarn |
44 | 41 |
|
45 | 42 | - name: Install dependencies |
46 | 43 | run: yarn --frozen-lockfile |
|
67 | 64 | - name: Verify generated example artifacts |
68 | 65 | run: yarn check:examples-md |
69 | 66 |
|
70 | | - - name: Run smoke tests (Shard ${{ matrix.shard }}/4) |
71 | | - id: tests |
72 | | - shell: python |
73 | | - run: | |
74 | | - from subprocess import Popen, PIPE |
75 | | - import sys |
76 | | -
|
77 | | - proc = Popen(["yarn", "test:smoke", "--shard=${{ matrix.shard }}/4", "--color"], stderr=PIPE) |
78 | | - zstd = Popen(["zstd", "-q", "-5", "-o", "smoke-tests-shard-${{ matrix.shard }}.zst"], stdin=PIPE) |
79 | | - tee = Popen(["tee", "-i", "/dev/stderr"], stdin=proc.stderr, stdout=zstd.stdin) |
80 | | - proc.stderr.close() |
81 | | - sys.exit(proc.wait()) |
82 | | -
|
83 | | - - name: Upload test output |
84 | | - if: always() |
85 | | - uses: runloopai/upload-artifact@main |
86 | | - with: |
87 | | - path: smoke-tests-shard-${{ matrix.shard }}.zst |
88 | | - if-no-files-found: error |
89 | | - retention-days: 1 |
90 | | - archive: false |
91 | | - |
92 | | - smoke-tests-results: |
93 | | - runs-on: ubuntu-slim |
94 | | - needs: smoke-tests |
95 | | - if: always() |
96 | | - steps: |
97 | | - - name: Download all test output artifacts |
98 | | - uses: runloopai/download-artifact@main |
99 | | - with: |
100 | | - pattern: smoke-tests-shard-*.zst |
101 | | - path: all-output |
102 | | - |
103 | | - - name: Decompress and display logs |
104 | | - run: | |
105 | | - # Decompress all files |
106 | | - zstd -q --rm -d all-output/*/*.zst |
107 | | -
|
108 | | - BOLD=$'\033[1m' |
109 | | - RESET=$'\033[22m' |
110 | | - # Extract and display failed tests from each shard |
111 | | - for output_file in all-output/*/*; do |
112 | | - shard_name=$(basename "$output_file") |
113 | | - # Check if this shard has failures |
114 | | - if grep -q "FAIL\|✕" "$output_file" 2>/dev/null; then |
115 | | - echo "$BOLD$shard_name had test failures$RESET" |
116 | | - # Filter output to show only failures: |
117 | | - # - Skip PASS suites entirely (from PASS to next FAIL or "Test Suites:") |
118 | | - # - Within FAIL suites, skip individual passing tests (✓) but show failures (● and ✕) |
119 | | - awk ' |
120 | | - { line=$0; gsub(/\x1b\[[0-9;]*m/, "") } |
121 | | - /^[[:space:]]*PASS[[:space:]]/ { in_pass_suite=1; in_fail_suite=0; next } |
122 | | - /^[[:space:]]*FAIL[[:space:]]/ { in_pass_suite=0; in_fail_suite=1; print line; next } |
123 | | - /^Test Suites:/ { in_pass_suite=0; in_fail_suite=0; print line; next } |
124 | | - in_pass_suite { next } |
125 | | - in_fail_suite && /^[[:space:]]*✓/ { next } |
126 | | - in_fail_suite { print line; next } |
127 | | - { print line } |
128 | | - ' "$output_file" |
129 | | - fi |
130 | | - done |
131 | | -
|
132 | | - # Aggregate all output in a collapsed group |
133 | | - echo "::group::Full output from all shards" |
134 | | - for output_file in all-output/*/*; do |
135 | | - shard_name=$(basename "$output_file") |
136 | | - echo "$BOLD=== $shard_name ===$RESET" |
137 | | - cat "$output_file" |
138 | | - echo "" |
139 | | - done |
140 | | - echo "::endgroup::" |
| 67 | + - name: Run smoke tests |
| 68 | + run: yarn test:smoke --maxWorkers=800% --color |
0 commit comments