Skip to content

Commit

Permalink
Adding Github Actions for CI/CD (#30)
Browse files Browse the repository at this point in the history
* Add flutter-action for test

* Run flutter-action on every push

* Flutter analyze ignore fatal infos

* Add format job in flutter-action

* Rename flutter-action to ci

* Adding caches to ci

* Use github.ref + pubspec.yaml hash for cache key

* Limit pull_request trigger for ci

* Add cd github action

* Ignore push with changes on folder starting with `.` and files ending with `.md`

* Remove empty lines

* Remove empty lines

* Remove comments

* Update cd.yml

* Fix cat -> echo $ENV

* Remove all comments

* Remove comments

* Remove empty line

* Use k-paxian/dart-package-publisher action for CD

* Add line break at EOF

Co-authored-by: Felix <felix.wielander@gmail.com>
  • Loading branch information
calvintam236 and WieFel authored Jul 27, 2021
1 parent 9637a53 commit b605013
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: cd

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v2
- uses: k-paxian/dart-package-publisher@master
with:
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
format: true
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ci

on:
push:
paths-ignore:
- '**/*.md'
- '.*/**'
pull_request:
types:
- ready_for_review
- synchronize
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ github.ref }}-${{ hashFiles('pubspec.yaml') }}
- uses: subosito/flutter-action@v1
- run: flutter doctor -v
- run: flutter pub get
- run: flutter analyze --no-fatal-infos
- run: flutter test

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ github.ref }}-${{ hashFiles('pubspec.yaml') }}
- uses: subosito/flutter-action@v1
- run: flutter doctor -v
- run: flutter pub get
- run: flutter format --set-exit-if-changed --dry-run .

0 comments on commit b605013

Please sign in to comment.