Merge pull request #39 from kushalmahapatro/fix/github-actions #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Commit Push | |
on: | |
pull_request: | |
push: | |
branches: | |
- '*' | |
env: | |
flutter_version: "3.13.0" | |
java_version: "12.x" | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
discussions: write | |
jobs: | |
check-branch: | |
runs-on: ubuntu-latest | |
name: Check branch | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Flutter SDK | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }} | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.flutter_version }} | |
- run: flutter --version | |
- name: Install dependencies | |
run: dart pub get | |
- name: Analyze project source | |
run: dart analyze | |
- name: Run tests | |
run: dart test | |
- name: Run dart publish (dry run) | |
if: ${{ github.event.pull_request.base.ref == 'main' }} | |
run: dart pub publish --dry-run |