Skip to content

Commit

Permalink
ci: update ci-related scripts (#78)
Browse files Browse the repository at this point in the history
Closes #77
  • Loading branch information
rafamizes authored Aug 24, 2024
1 parent 21b6dcf commit a4154cd
Show file tree
Hide file tree
Showing 17 changed files with 238 additions and 131 deletions.
47 changes: 30 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ name: Flutter CI

# Controls when the action will run.
on:
# Triggers the workflow on push request events but only for the master branch
# Triggers the workflow on push or pull request events but only for the main branch
# Runs this action when you push on master
push:
branches: [master]
branches:
- master
# Runs this when a PR against master is created
pull_request:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -22,28 +27,36 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Java environment.
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '12.x'
- name: Clone repository
uses: actions/checkout@v4

# Setup the flutter environment.
- uses: subosito/flutter-action@v2
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.3.2"
channel: 'stable'
cache: true

- name: Verify Flutter version
run: flutter --version

# Get flutter dependencies.
- run: flutter pub get
- name: Getting dependencies
run: flutter pub get

# Check for any formatting issues in the code.
- run: flutter format --set-exit-if-changed lib/ test/ example/
# Statically analyze the Dart code for any errors.
- run: flutter analyze --no-current-package lib/ test/ example/
# Run widget tests for our flutter project.
- run: flutter test --no-pub --coverage
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed lib/ test/ example/

- name: Analyze project source
run: dart analyze --fatal-infos --fatal-warnings lib/ test/ example/

- name: Run tests
run: flutter test --no-pub --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
11 changes: 5 additions & 6 deletions .rultor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docker:
image: cirrusci/flutter:stable
image: ghcr.io/cirruslabs/flutter:stable
as_root: true
architect:
- rafamizes
Expand All @@ -10,10 +10,7 @@ merge:
script: |
flutter clean
flutter pub get
flutter format --set-exit-if-changed lib/ test/ example/
flutter analyze --no-current-package lib/ test/ example/
flutter test --no-pub --coverage
bash <(curl -s https://codecov.io/bash)
flutter test --no-pub
flutter pub publish --dry-run
release:
# updates pubspec.yaml's version attribute to $tag;
Expand All @@ -23,9 +20,11 @@ release:
# repository.
script: |-
sed -i "s/^\(version:\).*/\1 $tag/" pubspec.yaml
sed -i "/\[Unreleased\]/a\\\n## [$tag] - $(date '+%F')" CHANGELOG.md
sed -i "/\[[Uu]nreleased\]/a\\\n## [$tag] - $(date '+%F')" CHANGELOG.md
mkdir -p ~/.pub-cache
mv ../credentials.json ~/.pub-cache/credentials.json
flutter clean
flutter pub get
flutter pub publish -f
git commit -am "version $tag"
git checkout master
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Dart Package Versioning](https://dart.dev/tools/pub

## [Unreleased]

### Changed

- Update ci-related scripts.

## [0.4.3] - 2022-07-20

### Changed
Expand Down Expand Up @@ -115,7 +119,7 @@ _'Contribute'_ section to README — [65](https://github.com/dartoos-dev/well_fo

### Added

- EmailFiel, a text form field for entering email addresses —
- EmailField, a text form field for entering email addresses —
[8](https://github.com/dartoos-dev/well_formed/issues/8).

## [0.3.1] - 2021-08-12
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ android {

defaultConfig {
applicationId "dev.dartoos.example"
minSdkVersion 16
minSdkVersion flutter.minSdkVersion
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class _DemoApp extends StatelessWidget {
appBar: AppBar(
backgroundColor: const Cyan().color,
elevation: 0.0,
title: const Text('Well_formed demo app'),
title: const Text('Well_Formed Showcase App'),
),
body: Center(
child: SizedBox(
width: 350,
child: WellFormed.btn([
DigitField.len(
5,
diff: 'Please enter exactly 5 digits; for example, "22335".',
diff: 'Please enter exactly 5 digits. For example: "22335".',
blank: 'Please enter the 5 digits.',
decoration: InputDecoration(
labelText: 'Enter 5 digits',
Expand Down
Loading

0 comments on commit a4154cd

Please sign in to comment.