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.
This commit is contained in:
William Cheng 2025-08-30 21:33:54 +08:00 committed by GitHub
parent 9c1b680fdf
commit 443fd76529
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 57 additions and 0 deletions

View File

@ -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

View File

@ -21,3 +21,6 @@
#docs/*.md #docs/*.md
# Then explicitly reverse the ignore rule for a single file: # Then explicitly reverse the ignore rule for a single file:
#!docs/README.md #!docs/README.md
#
#
#

View File

@ -21,3 +21,4 @@
#docs/*.md #docs/*.md
# Then explicitly reverse the ignore rule for a single file: # Then explicitly reverse the ignore rule for a single file:
#!docs/README.md #!docs/README.md
#