Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): check the success of macos CI #3353

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 33 additions & 21 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ jobs:
needs.setup.outputs.RUN_MACOS_KOTLIN_BUILD == 'true' &&
!contains(needs.*.result, 'cancelled') &&
!contains(needs.*.result, 'failure')
outputs:
success: ${{ steps.setoutput.outputs.success }}
steps:
- uses: actions/checkout@v4

Expand All @@ -391,6 +393,10 @@ jobs:

- run: yarn cli build clients kotlin

- name: Set output
id: setoutput
run: echo "success=true" >> "$GITHUB_OUTPUT"

swift_cts_macos:
timeout-minutes: 20
runs-on: macos-latest
Expand All @@ -408,6 +414,8 @@ jobs:
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
MONITORING_API_KEY: ${{ secrets.MONITORING_API_KEY }}
outputs:
success: ${{ steps.setoutput.outputs.success }}
steps:
- uses: actions/checkout@v4

Expand All @@ -426,6 +434,10 @@ jobs:

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

- name: Set output
id: setoutput
run: echo "success=true" >> "$GITHUB_OUTPUT"

codegen:
runs-on: ubuntu-22.04
timeout-minutes: 15
Expand Down Expand Up @@ -463,27 +475,6 @@ jobs:
- name: Generate documentation specs with code snippets
run: yarn cli build specs ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).toRun }} --docs

- name: Build website
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
run: yarn website:build

- name: Deploy documentation
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
uses: nwtgck/[email protected]
with:
publish-dir: 'website/build'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
netlify-config-path: ./netlify.toml
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5

- name: Push generated code
id: pushGeneratedCode
run: yarn workspace scripts pushGeneratedCode
Expand Down Expand Up @@ -514,6 +505,27 @@ jobs:
| 🪓 Triggered by | [`${{ github.sha }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ github.sha }}) |
| 🍃 Generated commit | [`${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}) |
| 🌲 Generated branch | [`generated/${{ github.head_ref }}`](${{ github.event.pull_request.base.repo.html_url }}/tree/generated/${{ github.head_ref }}) |

- name: Build website
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
run: yarn website:build

- name: Deploy documentation
if: ${{ github.ref == 'refs/heads/main' || github.base_ref == 'main' }}
uses: nwtgck/[email protected]
with:
publish-dir: 'website/build'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
netlify-config-path: ./netlify.toml
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5

- name: Set output
id: setoutput
Expand Down
13 changes: 10 additions & 3 deletions scripts/cts/runCts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { isVerbose, run, runComposerInstall } from '../common.js';
import fsp from 'fs/promises';

import { exists, isVerbose, run, runComposerInstall, toAbsolutePath } from '../common.js';
import { getTestOutputFolder } from '../config.js';
import { createSpinner } from '../spinners.js';
import type { Language } from '../types.js';

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

const folders: string[] = [];
if (language !== 'dart' && language !== 'kotlin' && !excludeE2E) {
folders.push('e2e');
if (!excludeE2E) {
// check if the folder has files
const e2eFolder = toAbsolutePath(
`tests/output/${language}/${getTestOutputFolder(language)}/e2e`,
);
if ((await exists(e2eFolder)) && (await fsp.readdir(e2eFolder)).length > 0) folders.push('e2e');
}
if (!excludeUnit) {
folders.push('client', 'requests');
Expand Down
Loading