Skip to content

Commit 5c412b0

Browse files
authored
chore(ci): check the success of macos CI (#3353)
1 parent 74e1e2a commit 5c412b0

File tree

2 files changed

+43
-24
lines changed

2 files changed

+43
-24
lines changed

.github/workflows/check.yml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ jobs:
373373
needs.setup.outputs.RUN_MACOS_KOTLIN_BUILD == 'true' &&
374374
!contains(needs.*.result, 'cancelled') &&
375375
!contains(needs.*.result, 'failure')
376+
outputs:
377+
success: ${{ steps.setoutput.outputs.success }}
376378
steps:
377379
- uses: actions/checkout@v4
378380

@@ -391,6 +393,10 @@ jobs:
391393

392394
- run: yarn cli build clients kotlin
393395

396+
- name: Set output
397+
id: setoutput
398+
run: echo "success=true" >> "$GITHUB_OUTPUT"
399+
394400
swift_cts_macos:
395401
timeout-minutes: 20
396402
runs-on: macos-latest
@@ -408,6 +414,8 @@ jobs:
408414
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
409415
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
410416
MONITORING_API_KEY: ${{ secrets.MONITORING_API_KEY }}
417+
outputs:
418+
success: ${{ steps.setoutput.outputs.success }}
411419
steps:
412420
- uses: actions/checkout@v4
413421

@@ -426,6 +434,10 @@ jobs:
426434

427435
- run: yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }}
428436

437+
- name: Set output
438+
id: setoutput
439+
run: echo "success=true" >> "$GITHUB_OUTPUT"
440+
429441
codegen:
430442
runs-on: ubuntu-22.04
431443
timeout-minutes: 15
@@ -463,27 +475,6 @@ jobs:
463475
- name: Generate documentation specs with code snippets
464476
run: yarn cli build specs ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).toRun }} --docs
465477

466-
- name: Build website
467-
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
468-
run: yarn website:build
469-
470-
- name: Deploy documentation
471-
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
472-
uses: nwtgck/[email protected]
473-
with:
474-
publish-dir: 'website/build'
475-
production-branch: main
476-
github-token: ${{ secrets.GITHUB_TOKEN }}
477-
deploy-message: 'Deploy from GitHub Actions'
478-
enable-pull-request-comment: true
479-
enable-commit-comment: true
480-
overwrites-pull-request-comment: true
481-
netlify-config-path: ./netlify.toml
482-
env:
483-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
484-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
485-
timeout-minutes: 5
486-
487478
- name: Push generated code
488479
id: pushGeneratedCode
489480
run: yarn workspace scripts pushGeneratedCode
@@ -514,6 +505,27 @@ jobs:
514505
| 🪓 Triggered by | [`${{ github.sha }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ github.sha }}) |
515506
| 🍃 Generated commit | [`${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}) |
516507
| 🌲 Generated branch | [`generated/${{ github.head_ref }}`](${{ github.event.pull_request.base.repo.html_url }}/tree/generated/${{ github.head_ref }}) |
508+
509+
- name: Build website
510+
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
511+
run: yarn website:build
512+
513+
- name: Deploy documentation
514+
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
515+
uses: nwtgck/[email protected]
516+
with:
517+
publish-dir: 'website/build'
518+
production-branch: main
519+
github-token: ${{ secrets.GITHUB_TOKEN }}
520+
deploy-message: 'Deploy from GitHub Actions'
521+
enable-pull-request-comment: true
522+
enable-commit-comment: true
523+
overwrites-pull-request-comment: true
524+
netlify-config-path: ./netlify.toml
525+
env:
526+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
527+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
528+
timeout-minutes: 5
517529

518530
- name: Set output
519531
id: setoutput

scripts/cts/runCts.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { isVerbose, run, runComposerInstall } from '../common.js';
1+
import fsp from 'fs/promises';
2+
3+
import { exists, isVerbose, run, runComposerInstall, toAbsolutePath } from '../common.js';
4+
import { getTestOutputFolder } from '../config.js';
25
import { createSpinner } from '../spinners.js';
36
import type { Language } from '../types.js';
47

@@ -15,8 +18,12 @@ async function runCtsOne(
1518
const cwd = `tests/output/${language}`;
1619

1720
const folders: string[] = [];
18-
if (language !== 'dart' && language !== 'kotlin' && !excludeE2E) {
19-
folders.push('e2e');
21+
if (!excludeE2E) {
22+
// check if the folder has files
23+
const e2eFolder = toAbsolutePath(
24+
`tests/output/${language}/${getTestOutputFolder(language)}/e2e`,
25+
);
26+
if ((await exists(e2eFolder)) && (await fsp.readdir(e2eFolder)).length > 0) folders.push('e2e');
2027
}
2128
if (!excludeUnit) {
2229
folders.push('client', 'requests');

0 commit comments

Comments
 (0)