ci: add shorebird_ci-generated workflow alongside main.yaml (#3768)

This commit is contained in:
nickshorebird
2026-05-14 16:46:14 -04:00
committed by GitHub
parent 757b20f0fa
commit 431eaf4b53
2 changed files with 292 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
# Generated by shorebird_ci --style static. Safe to edit.
# Reusable workflow: CI steps for a single Dart package.
on:
workflow_call:
inputs:
package_name:
required: true
type: string
package_path:
required: true
type: string
has_bloc_lint:
required: false
default: false
type: boolean
has_unit_tests:
required: false
default: true
type: boolean
subpackages:
required: false
default: ""
type: string
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: dart-lang/setup-dart@v1
- name: Setup Bloc Tools
if: inputs.has_bloc_lint
uses: felangel/setup-bloc-tools@v0
- name: Install Dependencies
working-directory: ${{ inputs.package_path }}
run: |
dart pub get --no-example
for sub in ${{ inputs.subpackages }}; do
dart pub get --no-example -C $sub
done
- working-directory: ${{ inputs.package_path }}
run: dart format --set-exit-if-changed .
- working-directory: ${{ inputs.package_path }}
run: dart analyze .
- name: Bloc Lint
if: inputs.has_bloc_lint
working-directory: ${{ inputs.package_path }}
run: bloc lint .
- name: Run Tests
if: inputs.has_unit_tests
working-directory: ${{ inputs.package_path }}
run: |
dart pub global activate coverage && \
dart test --coverage=coverage && \
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib --check-ignore
- if: inputs.has_unit_tests
uses: codecov/codecov-action@v6
with:
flags: ${{ inputs.package_name }}
working-directory: ${{ inputs.package_path }}