Skip to content

Commit

Permalink
Add Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
n-bernat committed Sep 7, 2024
1 parent 95060c5 commit 0f6fadb
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@n-bernat
36 changes: 36 additions & 0 deletions .github/workflows/flutter_tests_beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# flutter_tests_*.yaml actions are duplicated, because GitHub doesn't support badges for matrix builds.
name: app_preferences - Tests (beta)
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
schedule:
- cron: "0 0 * * 0"

jobs:
build:
timeout-minutes: 5
name: Flutter tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"

- name: Print version
run: flutter --version

- name: Get dependencies
run: flutter pub get

- name: Check formatting
run: dart format . --set-exit-if-changed

- name: Run analyzer
run: flutter analyze
38 changes: 38 additions & 0 deletions .github/workflows/flutter_tests_min.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# flutter_tests_*.yaml actions are duplicated, because GitHub doesn't support badges for matrix builds.
name: app_preferences - Tests (3.24.0)
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
schedule:
- cron: "0 0 * * 0"

jobs:
build:
timeout-minutes: 5
name: Flutter tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version: "3.22.0"
channel: "stable"

- name: Print version
run: flutter --version

- name: Get dependencies
run: flutter pub get

- name: Check formatting
run: dart format . --set-exit-if-changed

- name: Run analyzer
run: flutter analyze
37 changes: 37 additions & 0 deletions .github/workflows/flutter_tests_stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# flutter_tests_*.yaml actions are duplicated, because GitHub doesn't support badges for matrix builds.
name: app_preferences - Tests (stable)
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
schedule:
- cron: "0 0 * * 0"

jobs:
build:
timeout-minutes: 5
name: Flutter tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
cache: true
channel: "stable"

- name: Print version
run: flutter --version

- name: Get dependencies
run: flutter pub get

- name: Check formatting
run: dart format . --set-exit-if-changed

- name: Run analyzer
run: flutter analyze
30 changes: 30 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to pub.dev
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
publish:
name: Publish to pub.dev
runs-on: ubuntu-latest

permissions:
id-token: write

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Publish to pub.dev
run: flutter pub publish --force

0 comments on commit 0f6fadb

Please sign in to comment.