-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.6 KB
/
pr-test.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
name: Unit Test
on:
pull_request:
branches:
- main
- develop
# Checkout the code, and run mxcl's xcodebuild action to run the unit tests
jobs:
build:
name: Build and unit test
runs-on: macos-12
steps:
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_13.3.app/Contents/Developer'
- name: Checkout repository
uses: actions/checkout@v3.3.0
with:
# PR's by default are pulled down as detached heads, meaning they can't be pushed back. Instead, checkout the actual branch, not the PR
ref: ${{ github.event.pull_request.head.ref }}
- name: Run Unit tests
# If its not a lokalise PR, run unit tests
if: ${{ !contains(github.head_ref, 'lokalise') }}
run: xcodebuild -project "Kukai Mobile.xcodeproj" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12,OS=15.0' -scheme "Kukai Mobile Debug" test
- name: For each localisation file, import to Xcode
# If it is a lokalise PR, find and import all .xliff files, and commit changes
if: ${{ contains(github.head_ref, 'lokalise') }}
run: |
find "$PWD/Kukai Mobile/Localization/Import" -type f -name "*.xliff" -maxdepth 1 | while read f ; do
xcodebuild -importLocalizations -project "Kukai Mobile.xcodeproj" -localizationPath "$f" ;
done
- name: Commit changes
if: ${{ success() && contains(github.head_ref, 'lokalise') }}
run: |
git add .
git commit -m "CI: import lokalise updates"
git push -u origin HEAD