Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null-Safety Bug Fix & GitHub Actions Workflow Improvements #1323

Merged
merged 5 commits into from
Jul 29, 2022
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
16 changes: 16 additions & 0 deletions .github/workflows/delete_old_runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Delete Old Workflow Runs
on:
schedule:
- cron: "0 0 * * 1" # Run every Monday
workflow_dispatch:

jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 7
keep_minimum_runs: 0
134 changes: 114 additions & 20 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,119 @@
name: Tests
name: Analyse & Build
on: [push, workflow_dispatch]

on:
push:
branches: master
pull_request:

defaults:
run:
shell: bash
jobs:
test:
name: "Analyze and test"
package-analysis:
name: "Analyse Package"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Dart Package Analyser
uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Package Scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < $TOTAL_MAX ))
then
echo Package score less than available score. Improve the score!
exit 1
fi

content-analysis:
name: "Analyse Contents"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
- run: flutter pub get
- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze --fatal-infos --fatal-warnings
- run: flutter test -r expanded
# - uses: actions/setup-java@v1
# with:
# java-version: '12.x'
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Ensure Correct Flutter Installation
run: flutter --version
- name: Get All Dependencies
run: flutter pub get
- name: Check Formatting
run: dart format --output=none --set-exit-if-changed .
- name: Check Lints
run: dart analyze --fatal-infos --fatal-warnings
- name: Run Tests
run: flutter test -r expanded

#check-example-changes:
# name: "Check Example Application For Changes"
# runs-on: "ubuntu-20.04"
# outputs:
# example_changed: ${{ steps.check_file_changed.outputs.example_changed }}
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - name: Compare Commit Diffs
# shell: pwsh
# id: check_file_changed
# run: |
# $diff = git diff --name-only HEAD^ HEAD
# $SourceDiff = $diff | Where-Object { $_ -match '^example/'}
# $HasDiff = $SourceDiff.Length -gt 0
# Write-Host "::set-output name=example_changed::$HasDiff"
#
#build-example:
# name: "Build Example Applications"
# runs-on: windows-latest
# needs: [check-example-changes, content-analysis, package-analysis]
# if: needs.check-example-changes.outputs.example_changed == 'True'
# defaults:
# run:
# working-directory: ./example
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v3
# - name: Setup Java 17 Environment
# uses: actions/setup-java@v3
# with:
# distribution: "temurin"
# java-version: "17"
# - name: Setup Flutter Environment
# uses: subosito/flutter-action@v2
# with:
# channel: "stable"
# - name: Ensure Correct Flutter Installation
# run: flutter --version
# - name: Ensure Clean Flutter Environment
# run: flutter clean
# - name: Remove Existing Prebuilt Applications
# run: Remove-Item "prebuiltExampleApplications" -Recurse -ErrorAction Ignore
# working-directory: .
# - name: Create Prebuilt Applications (Output) Directory
# run: md prebuiltExampleApplications
# working-directory: .
# - name: Build Android Application
# run: flutter build apk --split-per-abi --obfuscate --split-debug-info=/symbols
# - name: Move Android Application To Output Directory
# run: move "example\build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk" "prebuiltExampleApplications\AndroidApplication.apk"
# working-directory: .
# - name: Build Windows Application
# run: flutter build windows --obfuscate --split-debug-info=/symbols
# - name: Archive (ZIP) Windows Application To Output Directory
# uses: vimtor/action-zip@v1
# with:
# files: ./example/build/windows/runner/Release
# dest: prebuiltExampleApplications/WindowsApplication.zip
# - name: Commit Output Directory
# uses: EndBug/add-and-commit@v9.0.1
# with:
# message: "Built Example Applications"
# add: "prebuiltExampleApplications/"
# default_author: github_actions
13 changes: 6 additions & 7 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: 'Close stale issues and PR'
name: "Close stale issues and PR"
on:
schedule:
- cron: '30 1 * * *'
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days."
stale-pr-message: "This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days."
close-issue-message: "This issue was closed because it has been stalled for 5 days with no activity."
days-before-stale: 30
days-before-close: 5
days-before-pr-close: -1

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ class FMNetworkNoRetryImageProvider
return decode(bytes);
} catch (e) {
scheduleMicrotask(() {
_ambiguate(PaintingBinding.instance)?.imageCache.evict(key);
_ambiguate(_ambiguate(PaintingBinding.instance)?.imageCache)
?.evict(key);
});
rethrow;
} finally {
Expand Down