Skip to content

ci: fix validation to check changes #9

ci: fix validation to check changes

ci: fix validation to check changes #9

name: Socket client - Run all tests
on:
pull_request:
paths:
- "packages/socket-client/**"
- ".github/workflows/socket-client.ci.yml"
- ".github/workflows/socket-client-publish.ci.yml"
jobs:
test:
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- run: git config --global user.name SuperViz
- run: git config --global user.email [email protected]
- name: Intalling dependencies
run: |
cd packages/socket-client
dart pub get
- name: Verify formatting
id: format_check
run: |
cd packages/socket-client
dart format --output=write --set-exit-if-changed .
continue-on-error: true
- name: Check if formatting changed
id: format_changed
run: echo "formatting_changed=$(test -n "$(git status --porcelain)" && echo true || echo false)" >> $GITHUB_ENV
- name: Commit changes
if: steps.format_changed.outputs.formatting_changed == 'true'
run: |
git add .
git commit -m "chore(release): format code [skip ci]" || echo "No changes to commit"
git push
- name: Running build runner
run: |
cd packages/socket-client
dart run build_runner build
- name: Analyze project source
run: |
cd packages/socket-client
dart analyze
- name: Running tests
run: |
cd packages/socket-client
dart test