9570be87ba
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
# 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
|
|
needs_redis:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
- name: 🐳 Run Redis
|
|
if: inputs.needs_redis
|
|
run: |
|
|
docker pull redis/redis-stack-server:latest
|
|
docker run --name test_redis -d -p 6379:6379 --rm -e REDIS_ARGS="--requirepass password" redis/redis-stack-server:latest
|
|
- 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 --fatal-warnings .
|
|
- 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@v7
|
|
with:
|
|
flags: ${{ inputs.package_name }}
|
|
working-directory: ${{ inputs.package_path }}
|