forked from signalapp/Signal-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (81 loc) · 2.97 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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-12-Readme.md#xcode
DEVELOPER_DIR: /Applications/Xcode_14.2.app
jobs:
build_and_test:
name: Build and Test
timeout-minutes: 40
runs-on: macos-12
env:
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 7
steps:
- uses: actions/checkout@v3
- 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@v3
if: failure()
with:
name: Logs
path: ~/Library/Logs/scan
check_autogenstrings:
name: Check if strings file is outdated
timeout-minutes: 10
runs-on: macos-12
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- 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-12
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Fetch base commit
run: git fetch origin --depth 1 ${{ github.base_ref }}
- name: Install Dependencies
run: brew install clang-format python3
- name: Lint files changed in the PR
run: |
python3 Scripts/precommit.py --ref origin/${{ github.base_ref }} --skip_license_header_checks
# 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