From 443fd76529942780374d2a394aee4544d7c1641b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 30 Aug 2025 21:33:54 +0800 Subject: [PATCH] Add new workflow to test dart-dio samples (#21838) * add new workflow to test dart * fix * fix * fix versions * newer version * newer version * newer version * newer version * newer version * setup flutter * update * update * fix path * trigger build failure * Revert "trigger build failure" This reverts commit 36b688dfcb2937224add7186e84ea82b9f2ae76b. --- .../workflows/samples-dart-build-test.yaml | 53 +++++++++++++++++++ .../dart-dio/oneof/.openapi-generator-ignore | 3 ++ .../.openapi-generator-ignore | 1 + 3 files changed, 57 insertions(+) create mode 100644 .github/workflows/samples-dart-build-test.yaml diff --git a/.github/workflows/samples-dart-build-test.yaml b/.github/workflows/samples-dart-build-test.yaml new file mode 100644 index 00000000000..8865e93c8ee --- /dev/null +++ b/.github/workflows/samples-dart-build-test.yaml @@ -0,0 +1,53 @@ +name: Samples Dart (build, test) + +on: + push: + branches: + paths: + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/** + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/** + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/** + - samples/openapi3/client/petstore/dart-dio/oneof/** + - samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/** + - samples/openapi3/client/petstore/dart-dio/binary_response/** + pull_request: + paths: + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/** + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/** + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/** + - samples/openapi3/client/petstore/dart-dio/oneof/** + - samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/** + - samples/openapi3/client/petstore/dart-dio/binary_response/** + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + sdk: ["3.9.0"] + sample: + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/ + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/ + #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/ + - samples/openapi3/client/petstore/dart-dio/oneof/ + - samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/ + - samples/openapi3/client/petstore/dart-dio/binary_response/ + steps: + - uses: actions/checkout@v4 + + - uses: dart-lang/setup-dart@v1 + with: + sdk: ${{ matrix.sdk }} + + - name: pub get + working-directory: ${{ matrix.sample }} + run: dart pub get + + - name: build_runner build + working-directory: ${{ matrix.sample }} + run: dart run build_runner build + + - name: test + working-directory: ${{ matrix.sample }} + run: dart test diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore index 7484ee590a3..c5b04829c20 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore @@ -21,3 +21,6 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +# +# +# diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore index 7484ee590a3..daed634bb4b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore @@ -21,3 +21,4 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +#