From 99ea863e80382c34f4216208e354c681117db35a Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 18 Jan 2026 13:52:38 +0100 Subject: [PATCH] Finalized workflow --- .gitea/workflows/pull_request.yaml | 82 +----------------------------- .gitea/workflows/push.yaml | 55 +++++++++++++++----- 2 files changed, 44 insertions(+), 93 deletions(-) diff --git a/.gitea/workflows/pull_request.yaml b/.gitea/workflows/pull_request.yaml index ae375bb..4acc507 100644 --- a/.gitea/workflows/pull_request.yaml +++ b/.gitea/workflows/pull_request.yaml @@ -56,84 +56,4 @@ jobs: run: flutter pub get - name: Run tests - run: flutter test - - Format: - runs-on: ubuntu-latest - if: false - 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 --progress=dot: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 - # 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: 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 "" - git add lib test - git commit -m "Auto-format code [skip ci]" - git push origin HEAD:${{ gitea.head_ref }} - else - echo "No changes to commit" - fi - - - name: Verify format - run: flutter analyze lib test - - Update-Version: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.BOT_TOKEN }} - ref: ${{ gitea.head_ref }} - - - name: Update version - 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 "" - git add pubspec.yaml - git commit -m "Updated version number [skip ci]" - git push origin HEAD:${{ gitea.head_ref }} \ No newline at end of file + run: flutter test \ No newline at end of file diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml index eadeede..ef2d71a 100644 --- a/.gitea/workflows/push.yaml +++ b/.gitea/workflows/push.yaml @@ -7,6 +7,33 @@ on: - "main" jobs: + Test: + runs-on: ubuntu-latest + if: false + 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 --quiet 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 + Format: runs-on: ubuntu-latest if: false @@ -38,6 +65,8 @@ jobs: - 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 }} @@ -47,10 +76,10 @@ jobs: if [ -n "$(git status --porcelain lib test)" ]; then git config --global user.name "Gitea Actions [bot]" - git config --global user.email "actions@gitea.com" + git config --global user.email "" git add lib test - git commit -m "Auto-format code" - git push + git commit -m "Auto-format code [skip ci]" + git push origin HEAD:${{ gitea.head_ref }} else echo "No changes to commit" fi @@ -58,28 +87,30 @@ jobs: - name: Verify format run: flutter analyze lib test - - Update Version: + Update-Version: runs-on: ubuntu-latest + if: github.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: Update version uses: https://github.com/stikkyapp/update-pubspec-version@v2 with: - strategy: 'minor' + strategy: 'patch' path: './pubspec.yaml' + - name: Commit version update + env: + GITEA_TOKEN: ${{ secrets.BOT_TOKEN }} run: | - git fetch origin ${{ gitea.head_ref }} - git checkout ${{ gitea.head_ref }} - git config --global user.name "Gitea Actions [bot]" - git config --global user.email "actions@gitea.com" + git config --global user.email "" git add pubspec.yaml - git commit -m "Updated version number" - git push \ No newline at end of file + git commit -m "Updated version number [skip ci]" + git push origin HEAD:${{ gitea.head_ref }} \ No newline at end of file