chore(ci): update CI to include format and analyze commands

This commit is contained in:
ricardodalarme 2023-03-18 12:27:47 -03:00
parent 37f1d5518e
commit 6e40955758
3 changed files with 44 additions and 35 deletions

41
.github/workflows/code-check.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Code Check
on:
push:
branches: [main]
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Run Flutter Test
run: flutter test
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Run Flutter Format
run: dart format --set-exit-if-changed .
- name: Run Flutter Analyze
run: flutter analyze

View File

@ -1,9 +1,11 @@
name: release
on:
workflow_run:
workflows: [Test & Report]
workflows: [Code Check]
types:
- completed
branches:
- main
jobs:
release:

View File

@ -1,34 +0,0 @@
name: Test & Report
on:
pull_request:
push:
permissions:
id-token: write
contents: read
checks: write
statuses: write
jobs:
test:
name: Test & Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Get all Flutter Packages
run: flutter pub get
- name: Run Flutter Test
run: flutter test --machine > test-results.json
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results
path: test-results.json
reporter: dart-json