Skip to content

Commit e032c22

Browse files
authored
Add GUS to the quicklinks. Improve the CI to auto-generate the goldens files (#159)
* Remove unwanted files. * Add GUS links to the quick links. * Use SVG instead of PNG. * Add tests for the QuickLinksView. [CI UPDATE GOLDENS] * Bump version. * Remove unused import. * [CI UPDATE GOLDENS] * Speed up a little the animation. [CI UPDATE GOLDENS] * Forgot to change the checkout parameters. [CI UPDATE GOLDENS] * Oups.. [CI UPDATE GOLDENS] * Update golden files * Allow pubspec.lock * Add pubspec lock * Delete .packages Co-authored-by: apomalyn <apomalyn@users.noreply.github.com>
1 parent e8e8616 commit e032c22

File tree

11 files changed

+172
-43
lines changed

11 files changed

+172
-43
lines changed

.github/workflows/main-workflow.yaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ jobs:
5555
steps:
5656
- uses: actions/checkout@v2
5757
with:
58-
fetch-depth: 0 # Needed to push to refs
58+
ref: ${{ github.head_ref }}
59+
token: ${{ secrets.PTA }}
5960
- uses: actions/setup-java@v2
6061
with:
6162
distribution: 'adopt'
@@ -76,8 +77,37 @@ jobs:
7677
- run: flutter format --set-exit-if-changed .
7778
- run: flutter analyze
7879

79-
# Run the tests
80+
# Retrieve the last commit message and check if the commit message contains [CI UPDATE GOLDENS].
81+
# Set update_goldens output if the hot word is there.
82+
- name: "Check if needed to update goldens"
83+
if: github.event_name == 'pull_request'
84+
id: check_run_goldens
85+
run: |
86+
commit_msg=$(git log --format=%B -n 1 HEAD)
87+
88+
if [[ $commit_msg == *"[CI UPDATE GOLDENS]"* ]]; then
89+
echo ::set-output name=update_goldens::true
90+
fi
91+
92+
# Run the tests with --update-goldens.
93+
- name: Update goldens
94+
if: ${{ steps.check_run_goldens.outputs.update_goldens == 'true' }}
95+
run: flutter test --coverage --update-goldens
96+
97+
# Commit and push the goldens files updated.
98+
- name: Commit golden files
99+
id: commit
100+
if: ${{ steps.check_run_goldens.outputs.update_goldens == 'true' }}
101+
uses: stefanzweifel/git-auto-commit-action@v4
102+
with:
103+
file_pattern: test/*
104+
commit_user_name: github-actions[bot]
105+
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
106+
commit_message: "Update golden files"
107+
108+
# Run the tests
80109
- run: flutter test --coverage
110+
if: ${{ steps.check_run_goldens.outputs.update_goldens != 'true' }}
81111

82112
- name: Upload coverage file
83113
uses: actions/upload-artifact@v2

assets/images/ic_gus_red.svg

Lines changed: 36 additions & 0 deletions
Loading

lib/core/constants/quick_links.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FLUTTER / DART / THIRD-PARTIES
22
import 'package:flutter/widgets.dart';
3+
import 'package:flutter_svg/flutter_svg.dart';
34
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
45
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
56

@@ -71,4 +72,9 @@ List<QuickLink> quickLinks(AppIntl intl) => [
7172
size: 64,
7273
),
7374
link: 'http://rubik.clubnaova.ca/'),
75+
QuickLink(
76+
name: intl.ets_gus,
77+
image: SvgPicture.asset('assets/images/ic_gus_red.svg',
78+
color: AppTheme.etsLightRed),
79+
link: 'https://gus.etsmtl.ca/c2atom/mobile/login'),
7480
];

lib/l10n/intl_en.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"ets_directory_title": "Directory",
128128
"ets_heuristique_title": "L'heuristique",
129129
"ets_schedule_generator": "Rubik",
130+
"ets_gus": "GUS",
130131

131132
"more_about_applets_title": "About ApplETS",
132133
"more_report_bug": "Report a bug",

lib/l10n/intl_fr.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"ets_directory_title": "Bottin",
126126
"ets_heuristique_title": "L'heuristique",
127127
"ets_schedule_generator": "Rubik",
128+
"ets_gus": "GUS",
128129

129130
"more_about_applets_title": "À propos d'ApplETS",
130131
"more_report_bug": "Rapporter un bogue",

lib/ui/views/grades_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class _GradesViewState extends State<GradesView> {
5050
itemBuilder: (BuildContext context, int index) =>
5151
AnimationConfiguration.staggeredList(
5252
position: index,
53-
duration: const Duration(seconds: 1),
53+
duration: const Duration(milliseconds: 750),
5454
child: SlideAnimation(
5555
verticalOffset: 50.0,
5656
child: FadeInAnimation(

package-lock.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)