Skip to content

Commit

Permalink
ci: restructured, cleaned, added pub.dev checks (#108)
Browse files Browse the repository at this point in the history
* ci: proper naming and cleanup

- [deploy_demo]: proper step name, switched to "stable"
- [pr_title]: proper step name

* proper job names

* renaming files and actions

* - ci: seperated `check_formatting` job, added `pub_dev_publish_check` job

* readme: changed ci badge
  • Loading branch information
daadu authored Dec 19, 2021
1 parent 53cb24c commit f6687ec
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 54 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/analysis.yml

This file was deleted.

19 changes: 9 additions & 10 deletions .github/workflows/deploy_demo.yaml → .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Demo
name: cd

on:
push:
Expand All @@ -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 }}
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
18 changes: 0 additions & 18 deletions .github/workflows/pr_title.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p>
<a href="https://pub.dev/packages/backdrop"><img src="https://img.shields.io/pub/v/backdrop?logo=dart" alt="pub.dev"></a>
<a href="https://github.com/fluttercommunity/backdrop/actions?query=workflow%3Aanalysis"><img src="https://github.com/fluttercommunity/backdrop/workflows/analysis/badge.svg" alt="analysis"></a>
<a href="https://github.com/fluttercommunity/backdrop/actions/workflows/ci.yml"><img src="https://github.com/fluttercommunity/backdrop/actions/workflows/ci.yml/badge.svg" alt="ci"></a>
<a href="https://fluttercommunity.github.io/backdrop/demo/#/"><img src="https://img.shields.io/badge/check-demo-blueviolet" alt="Demo"></a>
<a href="https://github.com/Solido/awesome-flutter"><img alt="Awesome Flutter" src="https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true" /></a>
<a href="https://gitter.im/flutter-backdrop/community?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/flutter-backdrop/community.svg" alt="Gitter"></a>
Expand Down

0 comments on commit f6687ec

Please sign in to comment.