From f6b726717945d9660adf42a6cf2a71b514bcae85 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 May 2025 16:07:22 -0600 Subject: [PATCH 1/4] use gha-dart-oss --- .github/workflows/dart_ci.yml | 47 ++++++++++++++--------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index c2adfc52..ebc31b13 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -10,45 +10,36 @@ on: - '**' jobs: + checks: + uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.7 + build: + uses: Workiva/gha-dart-oss/.github/workflows/build.yaml@v0.1.7 + + test-unit: runs-on: ubuntu-latest + name: ${{ matrix.release-mode && 'release' || 'dev' }} strategy: fail-fast: false matrix: - sdk: [ 2.19.6 ] + release-mode: [true, false] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: dart-lang/setup-dart@v1 with: - sdk: ${{ matrix.sdk }} + sdk: 2.19.6 - - id: install - name: Install dependencies + - name: Install dependencies run: dart pub get timeout-minutes: 2 - - name: Check formatting - run: dart format . -l 120 --set-exit-if-changed - if: ${{ always() && steps.install.outcome == 'success' }} - - - name: Analyze project source - run: dart analyze - if: ${{ always() && steps.install.outcome == 'success' }} - - - name: Run tests (DDC) - run: | - dart run build_runner test -- -P concurrent-tests - dart run build_runner test -- -P non-concurrent-tests + - name: Run tests timeout-minutes: 10 - if: ${{ always() && steps.install.outcome == 'success' }} - - - name: Run tests (dart2js) run: | - dart run build_runner test -r -- -P concurrent-tests - dart run build_runner test -r -- -P non-concurrent-tests - timeout-minutes: 10 - if: ${{ always() && steps.install.outcome == 'success' }} - - uses: anchore/sbom-action@v0 - with: - path: ./ - format: cyclonedx-json + args=() + if [[ "${{ matrix.release-mode }}" == "true" ]]; then + args+=(--release) + fi + + dart run build_runner test "${args[@]}" -- -P concurrent-tests + dart run build_runner test "${args[@]}" -- -P non-concurrent-tests From f8e018f6298af15a4d76792d7b86e5fbd45a13e6 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 6 May 2025 20:36:17 -0600 Subject: [PATCH 2/4] added publish config --- .github/workflows/{dart_ci.yml => ci.yaml} | 2 +- .github/workflows/publish.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) rename .github/workflows/{dart_ci.yml => ci.yaml} (98%) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/ci.yaml similarity index 98% rename from .github/workflows/dart_ci.yml rename to .github/workflows/ci.yaml index ebc31b13..4d76c55b 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Dart CI +name: CI on: push: diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..f978e2e0 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,15 @@ +name: Publish + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: write + id-token: write + pull-requests: write + +jobs: + publish: + uses: Workiva/gha-dart-oss/.github/workflows/publish.yaml@v0.1.7 \ No newline at end of file From fa520e20106157f80eab2b4d92db0280b22b3916 Mon Sep 17 00:00:00 2001 From: Sydney Jodon Date: Wed, 7 May 2025 10:36:54 -0700 Subject: [PATCH 3/4] Separate step for formatting --- .github/workflows/ci.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d76c55b..6649ccb0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,13 +12,27 @@ on: jobs: checks: uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.7 + with: + format-check: false build: uses: Workiva/gha-dart-oss/.github/workflows/build.yaml@v0.1.7 + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + with: + sdk: 2.19.6 + + - name: Check formatting + run: dart format . -l 120 --set-exit-if-changed + if: ${{ always() && steps.install.outcome == 'success' }} + test-unit: runs-on: ubuntu-latest - name: ${{ matrix.release-mode && 'release' || 'dev' }} + name: unit tests (${{ matrix.release-mode && 'release' || 'dev' }}) strategy: fail-fast: false matrix: From b77bf4f5b656107f53c6592c50d5463011f52350 Mon Sep 17 00:00:00 2001 From: Sydney Jodon Date: Wed, 7 May 2025 12:00:33 -0700 Subject: [PATCH 4/4] Remove if line --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6649ccb0..61f0a03e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,6 @@ jobs: - name: Check formatting run: dart format . -l 120 --set-exit-if-changed - if: ${{ always() && steps.install.outcome == 'success' }} test-unit: runs-on: ubuntu-latest