From 4c034965a1fa36a4ee19fa16b824372948691e81 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:27:12 +0200 Subject: [PATCH 01/10] Squashed --- .github/workflows/benchmark.yaml | 46 +++ .github/workflows/dart.yml | 475 --------------------------- .github/workflows/protobuf.yaml | 50 +++ .github/workflows/protoc_plugin.yaml | 53 +++ benchmarks/mono_pkg.yaml | 10 - mono_repo.yaml | 15 - protobuf/mono_pkg.yaml | 16 - protoc_plugin/mono_pkg.yaml | 15 - tool/ci.sh | 135 -------- 9 files changed, 149 insertions(+), 666 deletions(-) create mode 100644 .github/workflows/benchmark.yaml delete mode 100644 .github/workflows/dart.yml create mode 100644 .github/workflows/protobuf.yaml create mode 100644 .github/workflows/protoc_plugin.yaml delete mode 100644 benchmarks/mono_pkg.yaml delete mode 100644 mono_repo.yaml delete mode 100644 protobuf/mono_pkg.yaml delete mode 100644 protoc_plugin/mono_pkg.yaml delete mode 100755 tool/ci.sh diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml new file mode 100644 index 000000000..05cb8279a --- /dev/null +++ b/.github/workflows/benchmark.yaml @@ -0,0 +1,46 @@ +name: benchmarks +permissions: read-all + +on: + pull_request: + branches: + paths: + - '.github/workflows/benchmarks.yaml' + - 'benchmarks/**' + - 'tool/setup.sh' + push: + branches: [ master ] + paths: + - '.github/workflows/benchmarks.yaml' + - 'benchmarks/**' + - 'tool/setup.sh' + schedule: + - cron: '0 0 * * 0' # weekly + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: benchmarks + strategy: + matrix: + sdk: dev + + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c + with: + sdk: ${{matrix.sdk}} + + - run: dart pub get + + - run: dart analyze --fatal-infos + + - run: dart format --output=none --set-exit-if-changed . + + - run: ./../tool/setup.sh + + - run: ./tool/compile_protos.sh + + - run: dart tool/compile_benchmarks.dart diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml deleted file mode 100644 index b6fe5a8ab..000000000 --- a/.github/workflows/dart.yml +++ /dev/null @@ -1,475 +0,0 @@ -# Created with package:mono_repo v6.6.3 -name: Dart CI -on: - push: - branches: master - pull_request: - schedule: - - cron: "0 0 * * 0" -defaults: - run: - shell: bash -env: - PUB_ENVIRONMENT: bot.github -permissions: read-all - -jobs: - job_001: - name: mono_repo self validate - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: stable - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.3 - - name: mono_repo self validate - run: dart pub global run mono_repo generate --validate - job_002: - name: "format_analyze; linux; Dart 3.7.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:analyze_1-analyze_2" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: "3.7.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart analyze lib - run: dart analyze lib - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart analyze test - run: dart analyze test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - job_003: - name: "format_analyze; linux; Dart dev; PKG: benchmarks; `dart format --output=none --set-exit-if-changed .`, `./../tool/setup.sh`, `./tool/compile_protos.sh`, `dart analyze --fatal-infos`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:benchmarks;commands:format_0-command_0-command_1-analyze_0" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:benchmarks - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: benchmarks_pub_upgrade - name: benchmarks; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: benchmarks - - name: "benchmarks; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.benchmarks_pub_upgrade.conclusion == 'success'" - working-directory: benchmarks - - name: benchmarks; ./../tool/setup.sh - run: ./../tool/setup.sh - if: "always() && steps.benchmarks_pub_upgrade.conclusion == 'success'" - working-directory: benchmarks - - name: benchmarks; ./tool/compile_protos.sh - run: ./tool/compile_protos.sh - if: "always() && steps.benchmarks_pub_upgrade.conclusion == 'success'" - working-directory: benchmarks - - name: "benchmarks; dart analyze --fatal-infos" - run: dart analyze --fatal-infos - if: "always() && steps.benchmarks_pub_upgrade.conclusion == 'success'" - working-directory: benchmarks - job_004: - name: "format_analyze; linux; Dart dev; PKG: protobuf; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:format_0-analyze_0" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: "protobuf; dart format --output=none --set-exit-if-changed ." - run: "dart format --output=none --set-exit-if-changed ." - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - - name: "protobuf; dart analyze --fatal-infos" - run: dart analyze --fatal-infos - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - job_005: - name: "format_analyze; linux; Dart dev; PKG: protoc_plugin; `dart format --output=none --set-exit-if-changed lib`, `./../tool/setup.sh`, `make protos`, `dart analyze --fatal-infos`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin;commands:format_1-command_0-command_2-analyze_0" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protoc_plugin_pub_upgrade - name: protoc_plugin; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protoc_plugin - - name: "protoc_plugin; dart format --output=none --set-exit-if-changed lib" - run: "dart format --output=none --set-exit-if-changed lib" - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; ./../tool/setup.sh - run: ./../tool/setup.sh - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; make protos - run: make protos - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: "protoc_plugin; dart analyze --fatal-infos" - run: dart analyze --fatal-infos - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - job_006: - name: "run_tests; linux; Dart 3.7.0; PKG: protobuf; `dart test`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:test" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: "3.7.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart test - run: dart test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_007: - name: "run_tests; linux; Dart 3.7.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protoc_plugin;commands:command_0-command_2-test" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0;packages:protoc_plugin - os:ubuntu-latest;pub-cache-hosted;sdk:3.7.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: "3.7.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protoc_plugin_pub_upgrade - name: protoc_plugin; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; ./../tool/setup.sh - run: ./../tool/setup.sh - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; make protos - run: make protos - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; dart test - run: dart test - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_008: - name: "run_tests; linux; Dart dev; PKG: protobuf; `dart test`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:test" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart test - run: dart test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_009: - name: "run_tests; linux; Dart dev; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin;commands:command_0-command_2-test" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin - os:ubuntu-latest;pub-cache-hosted;sdk:dev - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protoc_plugin_pub_upgrade - name: protoc_plugin; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; ./../tool/setup.sh - run: ./../tool/setup.sh - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; make protos - run: make protos - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - - name: protoc_plugin; dart test - run: dart test - if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'" - working-directory: protoc_plugin - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_010: - name: "run_tests; osx; Dart 3.7.0; PKG: protobuf; `dart test`" - runs-on: macos-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:macos-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf;commands:test" - restore-keys: | - os:macos-latest;pub-cache-hosted;sdk:3.7.0;packages:protobuf - os:macos-latest;pub-cache-hosted;sdk:3.7.0 - os:macos-latest;pub-cache-hosted - os:macos-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: "3.7.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart test - run: dart test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_011: - name: "run_tests; osx; Dart dev; PKG: protobuf; `dart test`" - runs-on: macos-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 - with: - path: "~/.pub-cache/hosted" - key: "os:macos-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:test" - restore-keys: | - os:macos-latest;pub-cache-hosted;sdk:dev;packages:protobuf - os:macos-latest;pub-cache-hosted;sdk:dev - os:macos-latest;pub-cache-hosted - os:macos-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart test - run: dart test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_012: - name: "run_tests; windows; Dart 3.7.0; PKG: protobuf; `dart test`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: "3.7.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart test - run: dart test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_013: - name: "run_tests; windows; Dart dev; PKG: protobuf; `dart test`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: dev - - id: checkout - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - id: protobuf_pub_upgrade - name: protobuf; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: protobuf - - name: protobuf; dart test - run: dart test - if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'" - working-directory: protobuf - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml new file mode 100644 index 000000000..5957a2f32 --- /dev/null +++ b/.github/workflows/protobuf.yaml @@ -0,0 +1,50 @@ +name: protobuf +permissions: read-all + +on: + pull_request: + branches: + paths: + - '.github/workflows/protobuf.yaml' + - 'protobuf/**' + push: + branches: [ master ] + paths: + - '.github/workflows/protobuf.yaml' + - 'protobuf/**' + schedule: + - cron: '0 0 * * 0' # weekly + +jobs: + validate-protobuf: + defaults: + run: + working-directory: protobuf + strategy: + matrix: + sdk: [stable, dev] + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - sdk: stable + run-tests: true + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c + with: + sdk: ${{matrix.sdk}} + + - run: dart pub get + + - run: dart analyze --fatal-infos + if: always() + + - run: dart format --output=none --set-exit-if-changed . + if: ${{matrix.run-tests}} + if: always() + + - run: dart test + if: ${{matrix.run-tests}} + if: always() diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml new file mode 100644 index 000000000..395371fd2 --- /dev/null +++ b/.github/workflows/protoc_plugin.yaml @@ -0,0 +1,53 @@ +name: protoc_plugin +permissions: read-all + +on: + pull_request: + branches: + paths: + - '.github/workflows/protoc_plugin.yaml' + - 'protoc_plugin/**' + - 'tool/setup.sh' + push: + branches: [ master ] + paths: + - '.github/workflows/protoc_plugin.yaml' + - 'protoc_plugin/**' + - 'tool/setup.sh' + schedule: + - cron: '0 0 * * 0' # weekly + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: protoc_plugin + strategy: + matrix: + sdk: [stable, dev] + include: + - sdk: stable + run-tests: true + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c + with: + sdk: ${{matrix.sdk}} + + - run: dart pub get + + - run: ./../tool/setup.sh + + - run: make protos + + - run: dart analyze --fatal-infos + if: always() + + - run: dart format --output=none --set-exit-if-changed lib + if: ${{matrix.run-tests}} + if: always() + + - run: dart test + if: ${{matrix.run-tests}} + if: always() diff --git a/benchmarks/mono_pkg.yaml b/benchmarks/mono_pkg.yaml deleted file mode 100644 index df3f45473..000000000 --- a/benchmarks/mono_pkg.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# See https://github.com/dart-lang/mono_repo for details - -stages: - - format_analyze: - - group: - - format - - command: ./../tool/setup.sh - - command: ./tool/compile_protos.sh - - analyze: --fatal-infos - sdk: dev diff --git a/mono_repo.yaml b/mono_repo.yaml deleted file mode 100644 index 565f3074d..000000000 --- a/mono_repo.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# See https://github.com/google/mono_repo.dart for details on this file -self_validate: format_analyze - -github: - on: - # Run CI on pushes to the master branch, and on PRs against master. - push: - branches: master - pull_request: - schedule: - - cron: "0 0 * * 0" - -merge_stages: -- format_analyze -- run_tests diff --git a/protobuf/mono_pkg.yaml b/protobuf/mono_pkg.yaml deleted file mode 100644 index 4d9ca7b6c..000000000 --- a/protobuf/mono_pkg.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# See https://github.com/dart-lang/mono_repo for details - -stages: - - format_analyze: - - group: - - format - - analyze: --fatal-infos - sdk: [dev] - - group: - - analyze: lib - - analyze: test - sdk: [pubspec] - - run_tests: - - group: [test] - sdk: [pubspec, dev] - os: [linux, osx, windows] diff --git a/protoc_plugin/mono_pkg.yaml b/protoc_plugin/mono_pkg.yaml deleted file mode 100644 index 01f1e8980..000000000 --- a/protoc_plugin/mono_pkg.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# See https://github.com/dart-lang/mono_repo for details -stages: - - format_analyze: - - group: - - format: --output=none --set-exit-if-changed lib - - command: ./../tool/setup.sh - - command: make protos - - analyze: --fatal-infos - sdk: [dev] - - run_tests: - - group: - - command: ./../tool/setup.sh - - command: make protos - - test - sdk: [pubspec, dev] diff --git a/tool/ci.sh b/tool/ci.sh deleted file mode 100755 index 1b123cce0..000000000 --- a/tool/ci.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/bash -# Created with package:mono_repo v6.6.3 - -# Support built in commands on windows out of the box. - -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter pub" is called instead of "dart pub". -# This assumes that the Flutter SDK has been installed in a previous step. -function pub() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter pub "$@" - else - command dart pub "$@" - fi -} - -function format() { - command dart format "$@" -} - -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter analyze" is called instead of "dart analyze". -# This assumes that the Flutter SDK has been installed in a previous step. -function analyze() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter analyze "$@" - else - command dart analyze "$@" - fi -} - -if [[ -z ${PKGS} ]]; then - echo -e '\033[31mPKGS environment variable must be set! - TERMINATING JOB\033[0m' - exit 64 -fi - -if [[ "$#" == "0" ]]; then - echo -e '\033[31mAt least one task argument must be provided! - TERMINATING JOB\033[0m' - exit 64 -fi - -SUCCESS_COUNT=0 -declare -a FAILURES - -for PKG in ${PKGS}; do - echo -e "\033[1mPKG: ${PKG}\033[22m" - EXIT_CODE=0 - pushd "${PKG}" >/dev/null || EXIT_CODE=$? - - if [[ ${EXIT_CODE} -ne 0 ]]; then - echo -e "\033[31mPKG: '${PKG}' does not exist - TERMINATING JOB\033[0m" - exit 64 - fi - - dart pub upgrade || EXIT_CODE=$? - - if [[ ${EXIT_CODE} -ne 0 ]]; then - echo -e "\033[31mPKG: ${PKG}; 'dart pub upgrade' - FAILED (${EXIT_CODE})\033[0m" - FAILURES+=("${PKG}; 'dart pub upgrade'") - else - for TASK in "$@"; do - EXIT_CODE=0 - echo - echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m" - case ${TASK} in - analyze_0) - echo 'dart analyze --fatal-infos' - dart analyze --fatal-infos || EXIT_CODE=$? - ;; - analyze_1) - echo 'dart analyze lib' - dart analyze lib || EXIT_CODE=$? - ;; - analyze_2) - echo 'dart analyze test' - dart analyze test || EXIT_CODE=$? - ;; - command_0) - echo './../tool/setup.sh' - ./../tool/setup.sh || EXIT_CODE=$? - ;; - command_1) - echo './tool/compile_protos.sh' - ./tool/compile_protos.sh || EXIT_CODE=$? - ;; - command_2) - echo 'make protos' - make protos || EXIT_CODE=$? - ;; - format_0) - echo 'dart format --output=none --set-exit-if-changed .' - dart format --output=none --set-exit-if-changed . || EXIT_CODE=$? - ;; - format_1) - echo 'dart format --output=none --set-exit-if-changed lib' - dart format --output=none --set-exit-if-changed lib || EXIT_CODE=$? - ;; - test) - echo 'dart test' - dart test || EXIT_CODE=$? - ;; - *) - echo -e "\033[31mUnknown TASK '${TASK}' - TERMINATING JOB\033[0m" - exit 64 - ;; - esac - - if [[ ${EXIT_CODE} -ne 0 ]]; then - echo -e "\033[31mPKG: ${PKG}; TASK: ${TASK} - FAILED (${EXIT_CODE})\033[0m" - FAILURES+=("${PKG}; TASK: ${TASK}") - else - echo -e "\033[32mPKG: ${PKG}; TASK: ${TASK} - SUCCEEDED\033[0m" - SUCCESS_COUNT=$((SUCCESS_COUNT + 1)) - fi - - done - fi - - echo - echo -e "\033[32mSUCCESS COUNT: ${SUCCESS_COUNT}\033[0m" - - if [ ${#FAILURES[@]} -ne 0 ]; then - echo -e "\033[31mFAILURES: ${#FAILURES[@]}\033[0m" - for i in "${FAILURES[@]}"; do - echo -e "\033[31m $i\033[0m" - done - fi - - popd >/dev/null || exit 70 - echo -done - -if [ ${#FAILURES[@]} -ne 0 ]; then - exit 1 -fi From 54d480115caa96f75d51e916b0411d5f1be1c09e Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:28:03 +0200 Subject: [PATCH 02/10] dont use if always --- .github/workflows/protobuf.yaml | 3 --- .github/workflows/protoc_plugin.yaml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index 5957a2f32..c935cf8f7 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -39,12 +39,9 @@ jobs: - run: dart pub get - run: dart analyze --fatal-infos - if: always() - run: dart format --output=none --set-exit-if-changed . if: ${{matrix.run-tests}} - if: always() - run: dart test if: ${{matrix.run-tests}} - if: always() diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml index 395371fd2..577ebb24a 100644 --- a/.github/workflows/protoc_plugin.yaml +++ b/.github/workflows/protoc_plugin.yaml @@ -42,12 +42,9 @@ jobs: - run: make protos - run: dart analyze --fatal-infos - if: always() - run: dart format --output=none --set-exit-if-changed lib if: ${{matrix.run-tests}} - if: always() - run: dart test if: ${{matrix.run-tests}} - if: always() From 52f597d65c6457aeb29017c81fefe3d5bd372cfd Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:29:02 +0200 Subject: [PATCH 03/10] use continue again --- .github/workflows/protobuf.yaml | 1 + .github/workflows/protoc_plugin.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index c935cf8f7..08c2bb799 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -29,6 +29,7 @@ jobs: run-tests: true runs-on: ${{ matrix.os }} + continue-on-error: true steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml index 577ebb24a..27d8ab185 100644 --- a/.github/workflows/protoc_plugin.yaml +++ b/.github/workflows/protoc_plugin.yaml @@ -20,6 +20,7 @@ on: jobs: build: runs-on: ubuntu-latest + continue-on-error: true defaults: run: working-directory: protoc_plugin From 5327175edec9b2372ecc1d6065bbd0873fbbc431 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:29:31 +0200 Subject: [PATCH 04/10] fromatting error --- protoc_plugin/lib/names.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protoc_plugin/lib/names.dart b/protoc_plugin/lib/names.dart index cf176a70e..1512c78a6 100644 --- a/protoc_plugin/lib/names.dart +++ b/protoc_plugin/lib/names.dart @@ -50,7 +50,7 @@ class FieldNames { // `null` for scalar, repeated, and map fields. final String? ensureMethodName; - FieldNames( + FieldNames ( this.descriptor, this.index, this.sourcePosition, From 3c50f77128e15f7430a30d0ee7d17f2cc15de778 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:33:13 +0200 Subject: [PATCH 05/10] use if: success() || failure() --- .github/workflows/protobuf.yaml | 3 ++- .github/workflows/protoc_plugin.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index 08c2bb799..d058bb4fb 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -29,7 +29,6 @@ jobs: run-tests: true runs-on: ${{ matrix.os }} - continue-on-error: true steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 @@ -43,6 +42,8 @@ jobs: - run: dart format --output=none --set-exit-if-changed . if: ${{matrix.run-tests}} + if: success() || failure() - run: dart test if: ${{matrix.run-tests}} + if: success() || failure() diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml index 27d8ab185..53017a529 100644 --- a/.github/workflows/protoc_plugin.yaml +++ b/.github/workflows/protoc_plugin.yaml @@ -20,7 +20,6 @@ on: jobs: build: runs-on: ubuntu-latest - continue-on-error: true defaults: run: working-directory: protoc_plugin @@ -46,6 +45,8 @@ jobs: - run: dart format --output=none --set-exit-if-changed lib if: ${{matrix.run-tests}} + if: success() || failure() - run: dart test if: ${{matrix.run-tests}} + if: success() || failure() From 3a84a06a086c15ae54fb2bc743f942706849bdac Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:39:48 +0200 Subject: [PATCH 06/10] use brackets --- .github/workflows/protobuf.yaml | 4 ++-- .github/workflows/protoc_plugin.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index d058bb4fb..75034876f 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -42,8 +42,8 @@ jobs: - run: dart format --output=none --set-exit-if-changed . if: ${{matrix.run-tests}} - if: success() || failure() + if: {{ success() || failure() }} - run: dart test if: ${{matrix.run-tests}} - if: success() || failure() + if: {{ success() || failure() }} diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml index 53017a529..1a7f6ece5 100644 --- a/.github/workflows/protoc_plugin.yaml +++ b/.github/workflows/protoc_plugin.yaml @@ -45,8 +45,8 @@ jobs: - run: dart format --output=none --set-exit-if-changed lib if: ${{matrix.run-tests}} - if: success() || failure() + if: {{ success() || failure() }} - run: dart test if: ${{matrix.run-tests}} - if: success() || failure() + if: {{ success() || failure() }} From 1b12cc5e00ed4ab1d95e24d9617b719dda0e8418 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:42:48 +0200 Subject: [PATCH 07/10] fix --- .github/workflows/protobuf.yaml | 6 ++---- .github/workflows/protoc_plugin.yaml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index 75034876f..a54448c7c 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -41,9 +41,7 @@ jobs: - run: dart analyze --fatal-infos - run: dart format --output=none --set-exit-if-changed . - if: ${{matrix.run-tests}} - if: {{ success() || failure() }} + if: ${{matrix.run-tests && (success() || failure()) }} - run: dart test - if: ${{matrix.run-tests}} - if: {{ success() || failure() }} + if: ${{matrix.run-tests && (success() || failure()) }} diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml index 1a7f6ece5..82482905d 100644 --- a/.github/workflows/protoc_plugin.yaml +++ b/.github/workflows/protoc_plugin.yaml @@ -44,9 +44,7 @@ jobs: - run: dart analyze --fatal-infos - run: dart format --output=none --set-exit-if-changed lib - if: ${{matrix.run-tests}} - if: {{ success() || failure() }} + if: ${{matrix.run-tests && (success() || failure()) }} - run: dart test - if: ${{matrix.run-tests}} - if: {{ success() || failure() }} + if: ${{matrix.run-tests && (success() || failure()) }} From 9c94f2371ff88452f6afa9192296c9c8844bc9e6 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 25 Jul 2025 13:45:43 +0200 Subject: [PATCH 08/10] Revert "fromatting error" This reverts commit 5327175edec9b2372ecc1d6065bbd0873fbbc431. --- protoc_plugin/lib/names.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protoc_plugin/lib/names.dart b/protoc_plugin/lib/names.dart index 1512c78a6..cf176a70e 100644 --- a/protoc_plugin/lib/names.dart +++ b/protoc_plugin/lib/names.dart @@ -50,7 +50,7 @@ class FieldNames { // `null` for scalar, repeated, and map fields. final String? ensureMethodName; - FieldNames ( + FieldNames( this.descriptor, this.index, this.sourcePosition, From e19f21959b815359a8203438425c8e9e1869d279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20A=C4=9Facan?= Date: Mon, 28 Jul 2025 09:45:42 +0100 Subject: [PATCH 09/10] Run tests always --- .github/workflows/protobuf.yaml | 5 ----- .github/workflows/protoc_plugin.yaml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index a54448c7c..6185f0b19 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -24,9 +24,6 @@ jobs: matrix: sdk: [stable, dev] os: [ubuntu-latest, macos-latest, windows-latest] - include: - - sdk: stable - run-tests: true runs-on: ${{ matrix.os }} @@ -41,7 +38,5 @@ jobs: - run: dart analyze --fatal-infos - run: dart format --output=none --set-exit-if-changed . - if: ${{matrix.run-tests && (success() || failure()) }} - run: dart test - if: ${{matrix.run-tests && (success() || failure()) }} diff --git a/.github/workflows/protoc_plugin.yaml b/.github/workflows/protoc_plugin.yaml index 82482905d..4d561c906 100644 --- a/.github/workflows/protoc_plugin.yaml +++ b/.github/workflows/protoc_plugin.yaml @@ -26,9 +26,6 @@ jobs: strategy: matrix: sdk: [stable, dev] - include: - - sdk: stable - run-tests: true steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c @@ -44,7 +41,5 @@ jobs: - run: dart analyze --fatal-infos - run: dart format --output=none --set-exit-if-changed lib - if: ${{matrix.run-tests && (success() || failure()) }} - run: dart test - if: ${{matrix.run-tests && (success() || failure()) }} From 5b725d15856d1e436be2e0e88c532d7852135f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20A=C4=9Facan?= Date: Mon, 28 Jul 2025 09:51:38 +0100 Subject: [PATCH 10/10] Test protobuf with dart2js and dart2wasm --- .github/workflows/protobuf.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index 6185f0b19..70ff90713 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -40,3 +40,7 @@ jobs: - run: dart format --output=none --set-exit-if-changed . - run: dart test + + - run: dart test -p chrome -c dart2js + + - run: dart test -p chrome -c dart2wasm