Files
game-tracker/.gitea/workflows/push.yaml
Felix Kirchner eb404f3ef2
All checks were successful
Push Pipeline / test (push) Successful in 1m57s
Push Pipeline / update_version (push) Has been skipped
Push Pipeline / format (push) Successful in 2m17s
Fixed push pipeline
2026-01-20 11:54:15 +01:00

102 lines
3.0 KiB
YAML

name: Push Pipeline
on:
push:
branches:
- "development"
- "main"
- "hotfix/*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Flutter (wget)
run: |
wget --show-progress --progress=bar:force:noscroll:giga 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
git config --global --add safe.directory "$(pwd)/flutter"
echo "$(pwd)/flutter/bin" >> $GITEA_PATH
- name: Get dependencies
run: flutter pub get
- name: Run tests
run: flutter test
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Flutter (wget)
run: |
wget --show-progress --progress=bar:force:noscroll:giga 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
git config --global --add safe.directory "$(pwd)/flutter"
echo "$(pwd)/flutter/bin" >> $GITEA_PATH
- name: Get dependencies
run: flutter pub get
- name: Check code format
id: check_format
continue-on-error: true
run: flutter analyze lib test
- name: Format code
if: steps.check_format.outcome == 'failure'
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
git fetch origin ${{ gitea.head_ref }}
git checkout ${{ gitea.head_ref }}
dart fix --apply lib
dart fix --apply test
if [ -n "$(git status --porcelain lib test)" ]; then
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git add lib test
git commit -m "Auto-format code [skip ci]"
git push origin HEAD:${{ gitea.ref_name }}
else
echo "No changes to commit"
fi
- name: Verify format
run: flutter analyze lib test
update_version:
runs-on: ubuntu-latest
needs: Format
if: gitea.ref == 'refs/heads/development'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
ref: ${{ gitea.head_ref }}
- name: Increment version number
uses: https://github.com/stikkyapp/update-pubspec-version@v2
with:
strategy: 'patch'
path: './pubspec.yaml'
- name: Commit version update
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git add pubspec.yaml
git commit -m "Updated version number [skip ci]"
git push origin HEAD:${{ gitea.ref_name }}