Update translations #582
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- release/* | |
# On PRs, "head_ref" is defined and is consistent across updates. On | |
# pushes, it's not defined, so we use "run_id", which is unique across | |
# every run; as a result, all actions on pushes will run to completion. | |
# | |
# Reference: https://docs.github.com/en/actions/using-jobs/using-concurrency | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
# Path format pulled from https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#xcode | |
DEVELOPER_DIR: /Applications/Xcode_15.4.app | |
jobs: | |
build_and_test: | |
name: Build and Test | |
timeout-minutes: 20 | |
runs-on: macos-14-xlarge | |
env: | |
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 7 | |
strategy: | |
matrix: | |
xcode: ["Xcode_15.4", "Xcode_16_beta_6"] | |
steps: | |
- name: Set Xcode version | |
run: | | |
echo DEVELOPER_DIR=/Applications/${{matrix.xcode}}.app >> "$GITHUB_ENV" | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/clone-everything | |
with: | |
access-token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 # Reads .ruby-version file by default | |
with: | |
bundler-cache: true | |
- name: Build and Test | |
run: | | |
function formatFailures() { | |
grep '<failure message' fastlane/test_output/report.junit | sed -E "s/^.*<failure message='(.*)'>(.*):([0-9]+)<\/failure>/::error file=\2,line=\3::\1/" | sed -E 's/"/"/g' | |
exit 1 | |
} | |
bundle exec fastlane scan \ | |
--scheme Signal \ | |
--output_types junit \ | |
--skip_package_dependencies_resolution \ | |
--disable_package_automatic_updates \ | |
--xcargs '-test-timeouts-enabled YES -maximum-test-execution-time-allowance 60' \ | |
|| formatFailures | |
- name: Upload build logs | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: Logs | |
path: ~/Library/Logs/scan | |
check_autogenstrings: | |
name: Check if strings file is outdated | |
timeout-minutes: 10 | |
runs-on: macos-14 | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run genstrings | |
run: Scripts/translation/auto-genstrings | |
- name: Check for any changes | |
run: git diff --exit-code | |
lint: | |
name: Lint | |
timeout-minutes: 5 | |
runs-on: macos-14 | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch base commit | |
run: git fetch origin --depth 1 ${{ github.base_ref }} | |
- name: Install Dependencies | |
run: brew install clang-format swiftlint | |
- name: Lint files changed in the PR | |
run: | | |
Scripts/precommit.py --ref origin/${{ github.base_ref }} | |
# https://help.github.com/en/actions/reference/development-tools-for-github-actions#logging-commands | |
git diff --name-only | sed -E 's|(.*)|::error file=\1::Incorrectly formatted (Scripts/precommit.py)|' | |
git diff --exit-code || exit 1 |