Skip to content

Commit

Permalink
ci: update ci-related script files
Browse files Browse the repository at this point in the history
Closes #163
  • Loading branch information
rafamizes authored Aug 22, 2024
1 parent a90f09e commit dfc3fc5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 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

0 comments on commit dfc3fc5

Please sign in to comment.