Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
github-actions:
patterns:
- "*"
141 changes: 30 additions & 111 deletions .github/workflows/build-firebase.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: build firebase

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
workflow_dispatch:

Expand All @@ -11,153 +9,74 @@ on:
branches: [develop, main]
paths:
- "flutter_cache_manager_firebase/**"
- ".github/workflows/**"
- ".github/workflows/build-firebase.yaml"
pull_request:
branches: [develop, main]
paths:
- "flutter_cache_manager_firebase/**"
- ".github/workflows/**"
- ".github/workflows/build-firebase.yaml"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
format:
name: Format

# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: read

env:
source-directory: ./flutter_cache_manager_firebase
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# 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@v4
env:
FLUTTER_VERSION: "3.44.4"

# Make sure the stable version of Flutter is available
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}

# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}}

analyze:
name: Analyze

# The type of runner that the job will run on
jobs:
quality:
name: Format, Analyze & Test
runs-on: ubuntu-latest
timeout-minutes: 30

env:
source-directory: ./flutter_cache_manager_firebase
defaults:
run:
working-directory: ./flutter_cache_manager_firebase

# 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@v4
- uses: actions/checkout@v5

# Make sure the stable version of Flutter is available
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
architecture: x64
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true

# Download all Flutter packages
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}

# Run Flutter Analyzer
- name: Run Dart Format
run: dart format --set-exit-if-changed .

- name: Run Flutter Analyzer
run: flutter analyze
working-directory: ${{env.source-directory}}

tests:
name: Unit-tests
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
source-directory: ./flutter_cache_manager_firebase

# 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@v4

# Make sure the stable version of Flutter is available
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}

# Run all unit-tests with code coverage
# - name: Run unit tests
# run: flutter test --coverage
# working-directory: ${{env.source-directory}}

# # Upload code coverage information
# - uses: codecov/codecov-action@v4
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# with:
# files: ${{env.source-directory}}/coverage/lcov.info
# name: CacheManager
# fail_ci_if_error: true
- name: Run unit tests
run: flutter test --coverage

publish_cache_manager_firebase:
if: ${{ github.ref_type == 'tag' }}
name: Publish Cache Manager Firebase
permissions:
id-token: write
needs: [format, analyze, tests]
# The type of runner that the job will run on
contents: read
needs: [quality]
runs-on: ubuntu-latest
timeout-minutes: 15

env:
source-directory: ./flutter_cache_manager_firebase
defaults:
run:
working-directory: ./flutter_cache_manager_firebase

# 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@v4
- uses: actions/checkout@v5

- name: Set up Dart
uses: dart-lang/setup-dart@v1

# Make sure the stable version of Flutter is available
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}

# Publish the package
- name: Publish package
run: dart pub publish -v -f
working-directory: ${{env.source-directory}}
Loading