Some checks failed
Pull Request Pipeline / lint (pull_request) Has been skipped
Pull Request Pipeline / test (pull_request) Has been skipped
Pull Request Pipeline / localizations (pull_request) Has been skipped
Pull Request Pipeline / generate_localizations (pull_request) Failing after 28s
162 lines
4.3 KiB
YAML
162 lines
4.3 KiB
YAML
name: Pull Request Pipeline
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
if: false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
# Required for Flutter action
|
|
- name: Install jq
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y jq
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version: 3.41.0
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
|
|
flutter pub get
|
|
|
|
- name: Analyze Formatting
|
|
run: flutter analyze lib test
|
|
|
|
test:
|
|
if: false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
# Required for Flutter action
|
|
- name: Install jq
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y jq
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version: 3.41.0
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
|
|
flutter pub get
|
|
|
|
- name: Run tests
|
|
run: flutter test
|
|
|
|
localizations:
|
|
if: false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
# Required for Flutter action
|
|
- name: Install jq
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y jq
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version: 3.41.0
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
|
|
flutter pub get
|
|
|
|
- name: Check for untranslated messages
|
|
run: |
|
|
flutter gen-l10n --no-use-deferred-loading
|
|
|
|
UNTRANSLATED_FILE=lib/l10n/untranslated_messages.json
|
|
if [ ! -f "$UNTRANSLATED_FILE" ]; then
|
|
echo "Expected $UNTRANSLATED_FILE to be generated, but it does not exist."
|
|
exit 1
|
|
fi
|
|
|
|
CONTENT=$(tr -d '[:space:]' < "$UNTRANSLATED_FILE")
|
|
if [ "$CONTENT" != "{}" ]; then
|
|
echo "Found untranslated messages:"
|
|
cat "$UNTRANSLATED_FILE"
|
|
exit 1
|
|
fi
|
|
|
|
echo "All messages translated."
|
|
|
|
|
|
|
|
generate_localizations:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
# Required for Flutter action
|
|
- name: Install jq
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y jq
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
flutter-version: 3.41.0
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
|
|
flutter pub get
|
|
|
|
|
|
|
|
- name: Check generated files
|
|
id: generate_localizations
|
|
run: |
|
|
if [ -n "$(git status --porcelain lib/l10n)" ]; then
|
|
echo "has_changes=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "has_changes=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Commit generated localizations
|
|
if: steps.generate_localizations.outputs.has_changes == 'true'
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
|
|
run: |
|
|
# git fetch origin ${{ gitea.ref_name }}
|
|
git fetch origin ${{ gitea.head_ref }}
|
|
# git checkout ${{ gitea.ref_name }}
|
|
git checkout ${{ gitea.head_ref }}
|
|
|
|
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 config pull.rebase false
|
|
# git pull origin ${{ gitea.ref_name }}
|
|
git pull origin ${{ gitea.head_ref }}
|
|
git add lib/l10n
|
|
git commit -m "Generated localizations [skip ci]"
|
|
# git push origin HEAD:${{ gitea.ref_name }}
|
|
git push origin HEAD:${{ gitea.head_ref }}
|
|
else
|
|
echo "No changes to commit"
|
|
fi |