Merge pull request 'Actions aufsetzen' (#38) from setup/17-actions-aufsetzen into development
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 1m59s
Pull Request Pipeline / lint (pull_request) Successful in 2m1s

Reviewed-on: #38
Reviewed-by: mathiskir <mathis.kirchner.mk@gmail.com>
This commit was merged in pull request #38.
This commit is contained in:
2025-11-19 19:35:07 +00:00
4 changed files with 130 additions and 23 deletions

View File

@@ -0,0 +1,57 @@
name: Pull Request Pipeline
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Install Flutter (wget)
run: |
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz
tar xf flutter_linux_3.38.2-stable.tar.xz
# Set Git safe directory for Flutter path
git config --global --add safe.directory "$(pwd)/flutter"
# Set Flutter path
echo "$(pwd)/flutter/bin" >> $GITHUB_PATH
- name: Get dependencies
run: flutter pub get
- name: Analyze Formatting
run: flutter analyze lib test
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y jq
- name: Install Flutter (wget)
run: |
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz
tar xf flutter_linux_3.38.2-stable.tar.xz
# Set Git safe directory for Flutter path
git config --global --add safe.directory "$(pwd)/flutter"
# Set Flutter path
echo "$(pwd)/flutter/bin" >> $GITHUB_PATH
- name: Get dependencies
run: flutter pub get
- name: Run tests
run: flutter test

View File

@@ -0,0 +1,50 @@
name: Push Pipeline
on:
push:
branches:
- "development"
- "main"
jobs:
format:
runs-on: ubuntu-latest
if: false # Needs bot user
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get install -y jq
- name: Install Flutter (wget)
run: |
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.2-stable.tar.xz
tar xf flutter_linux_3.38.2-stable.tar.xz
# Set Git safe directory for Flutter path
git config --global --add safe.directory "$(pwd)/flutter"
# Set Flutter path
echo "$(pwd)/flutter/bin" >> $GITHUB_PATH
- name: Get & upgrade dependencies
run: |
flutter pub get
flutter pub upgrade --major-versions
- name: Auto-format
run: |
dart format lib
dart fix --apply lib
# Needs credentials, push access and the right files need to be staged
- name: Commit Changes
run: |
git config --global user.name "Gitea Actions"
git config --global user.email "actions@gitea.com"
git status
git add lib/
git status
git commit -m "Actions: Auto-formatting [skip ci]"
git push

View File

@@ -134,16 +134,16 @@ class _GameHistoryViewState extends State<GameHistoryView> {
children: [ children: [
Column( Column(
children: [ children: [
Container(margin: EdgeInsets.only(bottom: 75)), Container(margin: const EdgeInsets.only(bottom: 75)),
Expanded( Expanded(
child: gameHistoryListView(allGameData, suggestedGameData), child: gameHistoryListView(allGameData, suggestedGameData),
), ),
], ],
), ),
Container( Container(
margin: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10), margin: const EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10),
child: SearchBar( child: SearchBar(
leading: Icon(Icons.search), leading: const Icon(Icons.search),
onChanged: (value) { onChanged: (value) {
if (value.isEmpty) { if (value.isEmpty) {
setState(() { setState(() {
@@ -178,16 +178,16 @@ class _GameHistoryViewState extends State<GameHistoryView> {
Widget gameHistoryListView(allGameData, suggestedGameData) { Widget gameHistoryListView(allGameData, suggestedGameData) {
if (suggestedGameData.isEmpty && allGameData.isEmpty) { if (suggestedGameData.isEmpty && allGameData.isEmpty) {
return TopCenteredMessage( return const TopCenteredMessage(
icon: Icons.info, icon: Icons.info,
title: "Info", title: 'Info',
message: "Keine Spiele erstellt", message: 'Keine Spiele erstellt',
); );
} else if (suggestedGameData.isEmpty) { } else if (suggestedGameData.isEmpty) {
return TopCenteredMessage( return const TopCenteredMessage(
icon: Icons.search, icon: Icons.search,
title: "Info", title: 'Info',
message: "Kein Spiel mit den Suchparametern gefunden.", message: 'Kein Spiel mit den Suchparametern gefunden.',
); );
} }
return ListView.builder( return ListView.builder(
@@ -195,9 +195,9 @@ Widget gameHistoryListView(allGameData, suggestedGameData) {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final currentGame = suggestedGameData[index]; final currentGame = suggestedGameData[index];
return doubleRowInfoTile( return doubleRowInfoTile(
currentGame['game'] + ": ", currentGame['game'] + ': ',
currentGame['title'], currentGame['title'],
currentGame['players'].toString() + " Spieler", "${currentGame['players']} Spieler",
currentGame['group'], currentGame['group'],
currentGame['date'], currentGame['date'],
); );

View File

@@ -9,8 +9,8 @@ Widget doubleRowInfoTile(
String titleLowerRight, String titleLowerRight,
) { ) {
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 5, horizontal: 10), margin: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
padding: EdgeInsets.all(10), padding: const EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
color: CustomTheme.secondaryColor, color: CustomTheme.secondaryColor,
@@ -22,18 +22,18 @@ Widget doubleRowInfoTile(
Expanded( Expanded(
flex: 10, flex: 10,
child: Text( child: Text(
"$titleOneUpperLeft $titleTwoUpperLeft", '$titleOneUpperLeft $titleTwoUpperLeft',
style: TextStyle(fontSize: 20), style: const TextStyle(fontSize: 20),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
), ),
Spacer(), const Spacer(),
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(
"$titleUpperRight", titleUpperRight,
style: TextStyle(fontSize: 20), style: const TextStyle(fontSize: 20),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
textAlign: TextAlign.end, textAlign: TextAlign.end,
@@ -46,18 +46,18 @@ Widget doubleRowInfoTile(
Expanded( Expanded(
flex: 10, flex: 10,
child: Text( child: Text(
"$titleLowerLeft", titleLowerLeft,
style: TextStyle(fontSize: 20), style: const TextStyle(fontSize: 20),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
), ),
Spacer(), const Spacer(),
Expanded( Expanded(
flex: 4, flex: 4,
child: Text( child: Text(
"$titleLowerRight", titleLowerRight,
style: TextStyle(fontSize: 20), style: const TextStyle(fontSize: 20),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
textAlign: TextAlign.end, textAlign: TextAlign.end,