Skip to content

feat: v0.1.0 - simplify form APIs and generator, upgrade dependencies #24

feat: v0.1.0 - simplify form APIs and generator, upgrade dependencies

feat: v0.1.0 - simplify form APIs and generator, upgrade dependencies #24

Workflow file for this run

name: Check Pull Request
on:
pull_request:
branches:
- main
jobs:
semantic_pull_request:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
outputs:
coverage-matrix: ${{ steps.coverage-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1.7.1
- name: Install Melos
run: dart pub global activate melos
- name: Install Dependencies
run: melos bootstrap
- name: Format
run: melos run format:ci
- name: Analyze
run: dart analyze --fatal-infos --fatal-warnings .
- name: Run Tests
run: |
dart pub global activate coverage
melos exec --dir-exists="test" -- "dart test --coverage=coverage"
melos exec --dir-exists="test" -- "dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --package=. --report-on=lib"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: coverage
path: packages/**/coverage/lcov.info
- name: Generate Coverage Matrix
id: coverage-matrix
run: |
matrix_json="$(melos list --dir-exists="test" --json | jq -c --arg root "$PWD" '
[.[] | {
name: .name,
private: .private,
directory: (.location | ltrimstr($root + "/")),
path: ((.location | ltrimstr($root + "/")) + "/coverage/lcov.info")
}]
')"
echo "matrix=$matrix_json" >> "$GITHUB_OUTPUT"
echo "Generated coverage matrix: $matrix_json"
check_coverage:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.build.outputs.coverage-matrix) }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: coverage
path: packages/
- name: Check Code Coverage
if: ${{ !matrix.private }}
uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3
with:
path: ${{ matrix.path }}
min_coverage: 80
check_pana:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.build.outputs.coverage-matrix) }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1.7.1
- name: Install Melos
run: dart pub global activate melos
- name: Install Dependencies
run: melos bootstrap
- name: Install Pana
run: dart pub global activate pana
- name: Verify Pub Score
if: ${{ !matrix.private }}
run: |
MIN_SCORE=""
if [ -f "${{ matrix.directory }}/PANA_SCORE" ]; then
MIN_SCORE="$(cat "${{ matrix.directory }}/PANA_SCORE")"
fi
if [ "${{ matrix.name }}" = "shape" ]; then
cd "${{ matrix.directory }}" || exit
../../tool/verify_pub_score.sh "$MIN_SCORE"
else
tool/verify_pub_score_workspace.sh "$MIN_SCORE" "${{ matrix.directory }}"
fi