diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml deleted file mode 100644 index ae90f69..0000000 --- a/.github/workflows/analysis.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: analysis -on: [push, pull_request] - -jobs: - package-analysis: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Flutter - uses: subosito/flutter-action@v1 - - - name: Install dependencies - run: | - flutter pub get - (cd demo && flutter pub get) - - - name: Analyze Dart - run: flutter analyze . --fatal-infos - - - name: Validate Dart formatting - run: | - flutter format . - ./.github/workflows/scripts/validate-formatting.sh diff --git a/.github/workflows/deploy_demo.yaml b/.github/workflows/cd.yaml similarity index 68% rename from .github/workflows/deploy_demo.yaml rename to .github/workflows/cd.yaml index 37d9669..ed4900f 100644 --- a/.github/workflows/deploy_demo.yaml +++ b/.github/workflows/cd.yaml @@ -1,4 +1,4 @@ -name: Deploy Demo +name: cd on: push: @@ -7,19 +7,18 @@ on: workflow_dispatch: jobs: - deploy-for-web: + deploy-demo: + name: "Deploy demo app" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v1 - with: - channel: beta - - run: flutter config --enable-web - - run: flutter pub get - - name: Build for web + - name: "Checkout repo" + uses: actions/checkout@v2 + - name: "Install Flutter" + uses: subosito/flutter-action@v1 + - name: "Build demo app for web" working-directory: demo/ run: flutter build web --release - - name: Deploy + - name: "Deploy demo app to Github Pages" uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ce66654 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: ci + +on: [push, pull_request] + +jobs: + analyze: + name: "Flutter Analyze" + runs-on: ubuntu-latest + steps: + - name: "Checkout repo" + uses: actions/checkout@v2 + - name: "Install Flutter" + uses: subosito/flutter-action@v1 + - name: "Install dependencies" + run: flutter pub get && (cd demo && flutter pub get) + - name: "Analyze Dart code" + run: flutter analyze . --fatal-infos + + pub_dev_publish_check: + name: "Check pub.dev requirements" + runs-on: ubuntu-latest + steps: + - name: "Checkout repo" + uses: actions/checkout@v2 + - name: "Install Flutter" + uses: subosito/flutter-action@v1 + - name: "Install dependencies" + run: flutter pub get && (cd demo && flutter pub get) + - name: "Pub Check" + run: pub publish --dry-run + + check_formatting: + name: "Check code formatting" + runs-on: ubuntu-latest + steps: + - name: "Checkout repo" + uses: actions/checkout@v2 + - name: "Install Flutter" + uses: subosito/flutter-action@v1 + - name: "Install dependencies" + run: flutter pub get && (cd demo && flutter pub get) + - name: "Validate Dart formatting" + run: | + flutter format . + ./.github/workflows/scripts/validate-formatting.sh diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..b2e1497 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,18 @@ +name: pr + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + validate-pr-title: + name: "Validate PR title" + runs-on: ubuntu-latest + steps: + - name: "Validate PR title follows Conventional Commit format" + uses: amannn/action-semantic-pull-request@v3.4.6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_title.yaml b/.github/workflows/pr_title.yaml deleted file mode 100644 index 2e7488a..0000000 --- a/.github/workflows/pr_title.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Lint PR title -name: pr_title - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - -jobs: - validate: - name: Validate PR title - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v3.4.6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index a75024b..8f8cc8f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

pub.dev -analysis +ci Demo Awesome Flutter Gitter