Skip to content

Pull to refresh

Pull to refresh #272

Workflow file for this run

---
name: CI/CD
on:
push:
branches:
- "main"
pull_request:
types:
- opened
- synchronize
merge_group:
schedule:
- cron: "0 14 * * 1" # every monday at 9 in the morning CST
workflow_dispatch:
env:
CI: true
FLUTTER_CHANNEL: master
FLUTTER_VERSION: "4a4eb2a320" # TODO: Prefer flutter-version-file once back on beta.
permissions:
contents: read
jobs:
setup:
name: Setup
needs: []
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: πŸ“š Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: 🐦 Set up Flutter
id: flutter
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # v2.18.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🌐 Disable analytics
run: flutter --disable-analytics
- name: βš™οΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: πŸ“¦ Install dependencies
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
with:
run-bootstrap: true
build:
name: Build
needs: ["setup"]
timeout-minutes: ${{ (matrix.target == 'web') && 5 || 10 }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
target:
- web
- appbundle
# - ios
# - macos
# - windows
include:
- target: web
os: ubuntu-latest
flutter-flags: --release --wasm
- target: appbundle
os: ubuntu-latest
# This is the least optimized, but is significantly faster in CI.
# Android releases should be built locally on a beefy machine.
flutter-flags: --debug --no-tree-shake-icons --no-shrink
# - target: ios
# os: macos-latest
# flutter-flags: --debug --no-tree-shake-icons
# - target: macos
# os: macos-latest
# flutter-flags: --debug --no-tree-shake-icons
# - target: windows
# os: windows-latest
# flutter-flags: --debug --no-tree-shake-icons
steps:
- name: πŸ“š Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: 🐦 Set up Flutter
id: flutter
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # v2.18.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: β˜• Setup Java
if: ${{ matrix.target == 'appbundle' }}
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "jetbrains"
java-version: "17"
cache: "gradle"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🌐 Disable analytics
run: flutter --disable-analytics
- name: βš™οΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: πŸ“¦ Install dependencies
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
with:
run-bootstrap: true
- name: πŸ”§ Build
run: |
flutter build ${{ matrix.target }} ${{ matrix.flutter-flags }}
working-directory: packages/app/
- name: βš™οΈ Upload build
if: ${{ matrix.target == 'web' }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: app-${{ matrix.target }}-build
path: "./packages/app/build/"
if-no-files-found: error
lint:
name: Linting
needs: ["setup"]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: 🐦 Set up Flutter
id: flutter
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # v2.18.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🌐 Disable analytics
run: flutter --disable-analytics
- name: βš™οΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: πŸ“¦ Install dependencies
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
with:
run-bootstrap: true
- name: πŸ•΅οΈ Analyze project source
run: melos analyze --fatal-infos --concurrency=5
- name: πŸ•΅οΈ Run Custom Lint Rules
run: melos run custom_lint
test:
name: Testing
needs: ["setup"]
timeout-minutes: 7
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: 🐦 Set up Flutter
id: flutter
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # v2.18.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🌐 Disable analytics
run: flutter --disable-analytics
- name: βš™οΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
restore-keys: |
${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-
${{ runner.os }}-
- name: πŸ“¦ Install dependencies
uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa # v3
with:
run-bootstrap: true
- name: πŸ§ͺ Run tests
run: melos run test
continue-on-error: true
- name: πŸ“Š Upload code coverage
if: ${{ !cancelled() }}
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: packages/app/coverage/lcov.info
fail_ci_if_error: true
verbose: true
format:
name: Formatting
needs: ["setup"]
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: 🐦 Set up Flutter
id: flutter
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # v2.18.0
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🌐 Disable analytics
run: flutter --disable-analytics
- name: ✨ Verify formatting
run: melos format --output=none --set-exit-if-changed --concurrency=5
spell-check:
name: Check Spelling
needs: []
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: πŸͺ„ Spell Check
uses: streetsidesoftware/cspell-action@934c74da3775ac844ec89503f666f67efb427fed # v6.8.1
with:
files: |
**/*.md
**/*.dart
**/*.yaml
**/*.toml
**/*.json
incremental_files_only: false
link-check:
name: Check Links
needs: []
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- name: πŸͺ„ Link check
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # 1.0.15
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
base-branch: "main"
markdownlint:
name: Lint Markdown
needs: []
timeout-minutes: 4
runs-on: ubuntu-latest
steps:
- name: πŸ“š Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: πŸ•΅οΈ Markdown linting
uses: DavidAnson/markdownlint-cli2-action@db43aef879112c3119a410d69f66701e0d530809 # v17.0.0
id: markdownlint
with:
fix: true
# Surprisingly, the default is to only lint the project root.
globs: |
**/*.md