ci: add shorebird_ci-generated workflow alongside main.yaml (#3768)
This commit is contained in:
@@ -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 }}
|
||||
@@ -0,0 +1,230 @@
|
||||
# Generated by shorebird_ci --style static. Safe to edit.
|
||||
# Run `shorebird_ci verify` to check for dep graph drift.
|
||||
name: Shorebird CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
artifact_proxy: ${{ steps.filter.outputs.artifact_proxy }}
|
||||
dex: ${{ steps.filter.outputs.dex }}
|
||||
discord_gcp_alerts: ${{ steps.filter.outputs.discord_gcp_alerts }}
|
||||
flutter_version_resolver: ${{ steps.filter.outputs.flutter_version_resolver }}
|
||||
jwt: ${{ steps.filter.outputs.jwt }}
|
||||
scoped_deps: ${{ steps.filter.outputs.scoped_deps }}
|
||||
shorebird_build_trace: ${{ steps.filter.outputs.shorebird_build_trace }}
|
||||
shorebird_ci: ${{ steps.filter.outputs.shorebird_ci }}
|
||||
shorebird_cli: ${{ steps.filter.outputs.shorebird_cli }}
|
||||
shorebird_code_push_client: ${{ steps.filter.outputs.shorebird_code_push_client }}
|
||||
shorebird_code_push_protocol: ${{ steps.filter.outputs.shorebird_code_push_protocol }}
|
||||
shorebird_redis_client: ${{ steps.filter.outputs.shorebird_redis_client }}
|
||||
stripe_api: ${{ steps.filter.outputs.stripe_api }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
# Full history so dorny/paths-filter can diff on push events.
|
||||
fetch-depth: 0
|
||||
- uses: dart-lang/setup-dart@v1
|
||||
- run: dart pub global activate shorebird_ci
|
||||
- name: Verify CI coverage
|
||||
run: shorebird_ci verify
|
||||
- uses: dorny/paths-filter@v4
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
artifact_proxy:
|
||||
- packages/artifact_proxy/**
|
||||
dex:
|
||||
- packages/dex/**
|
||||
discord_gcp_alerts:
|
||||
- packages/discord_gcp_alerts/**
|
||||
flutter_version_resolver:
|
||||
- packages/flutter_version_resolver/**
|
||||
jwt:
|
||||
- packages/jwt/**
|
||||
scoped_deps:
|
||||
- packages/scoped_deps/**
|
||||
shorebird_build_trace:
|
||||
- packages/shorebird_build_trace/**
|
||||
shorebird_ci:
|
||||
- packages/shorebird_ci/**
|
||||
shorebird_cli:
|
||||
- packages/dex/**
|
||||
- packages/jwt/**
|
||||
- packages/shorebird_build_trace/**
|
||||
- packages/shorebird_cli/**
|
||||
- packages/shorebird_code_push_client/**
|
||||
- packages/shorebird_code_push_protocol/**
|
||||
shorebird_code_push_client:
|
||||
- packages/shorebird_code_push_client/**
|
||||
- packages/shorebird_code_push_protocol/**
|
||||
shorebird_code_push_protocol:
|
||||
- packages/shorebird_code_push_protocol/**
|
||||
shorebird_redis_client:
|
||||
- packages/redis_client/**
|
||||
stripe_api:
|
||||
- packages/stripe_api/**
|
||||
|
||||
artifact_proxy:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.artifact_proxy == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: artifact_proxy
|
||||
package_path: packages/artifact_proxy
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
dex:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.dex == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: dex
|
||||
package_path: packages/dex
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
discord_gcp_alerts:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.discord_gcp_alerts == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: discord_gcp_alerts
|
||||
package_path: packages/discord_gcp_alerts
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
flutter_version_resolver:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.flutter_version_resolver == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: flutter_version_resolver
|
||||
package_path: packages/flutter_version_resolver
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
jwt:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.jwt == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: jwt
|
||||
package_path: packages/jwt
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
scoped_deps:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.scoped_deps == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: scoped_deps
|
||||
package_path: packages/scoped_deps
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
shorebird_build_trace:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.shorebird_build_trace == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: shorebird_build_trace
|
||||
package_path: packages/shorebird_build_trace
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
shorebird_ci:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.shorebird_ci == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: shorebird_ci
|
||||
package_path: packages/shorebird_ci
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
shorebird_cli:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.shorebird_cli == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: shorebird_cli
|
||||
package_path: packages/shorebird_cli
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
shorebird_code_push_client:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.shorebird_code_push_client == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: shorebird_code_push_client
|
||||
package_path: packages/shorebird_code_push_client
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
shorebird_code_push_protocol:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.shorebird_code_push_protocol == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: shorebird_code_push_protocol
|
||||
package_path: packages/shorebird_code_push_protocol
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
shorebird_redis_client:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.shorebird_redis_client == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: shorebird_redis_client
|
||||
package_path: packages/redis_client
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
stripe_api:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.stripe_api == 'true'
|
||||
uses: ./.github/workflows/_shorebird_ci_dart.yaml
|
||||
with:
|
||||
package_name: stripe_api
|
||||
package_path: packages/stripe_api
|
||||
has_bloc_lint: false
|
||||
has_unit_tests: true
|
||||
subpackages: ""
|
||||
|
||||
cspell:
|
||||
name: CSpell
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: streetsidesoftware/cspell-action@v8
|
||||
with:
|
||||
incremental_files_only: false
|
||||
config: cspell.config.yaml
|
||||
|
||||
Reference in New Issue
Block a user