forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (84 loc) · 2.98 KB
/
verifyHybridApp.yml
File metadata and controls
92 lines (84 loc) · 2.98 KB
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
name: Verify HybridApp build
on:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths:
- '**.kt'
- '**.java'
- '**.swift'
- '**.mm'
- '**.h'
- '**.cpp'
- 'package.json'
- 'patches/**'
- 'android/build.gradle'
- 'android/AndroidManifest.xml'
- 'ios/Podfile.lock'
- 'ios/project.pbxproj'
pull_request_target:
types: [opened, synchronize]
branches: [main]
paths:
- '**.kt'
- '**.java'
- '**.swift'
- '**.mm'
- '**.h'
- '**.cpp'
- 'package.json'
- 'patches/**'
- 'android/build.gradle'
- 'android/AndroidManifest.xml'
- 'ios/Podfile.lock'
- 'ios/project.pbxproj'
permissions:
pull-requests: write
contents: read
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-verify-main
cancel-in-progress: true
jobs:
comment_on_fork:
name: Comment on all PRs that are forks
# Only run on pull requests that *are* a fork
if: ${{ github.event.pull_request.head.repo.fork && github.event_name == 'pull_request_target' }}
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Comment on forks
run: |
PR_URL="${{ github.event.pull_request.html_url }}"
COMMENT=":warning: This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. \
Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. \
Ask Contributor Plus for help if you are not sure how to handle this. :warning:"
# Fetch existing comments from author github-actions
EXISTING_COMMENTS="$(\
gh pr view "$PR_URL" \
--comments \
--json comments \
--jq '.comments[] | select(.author = "github-actions") | .body' \
)"
# Leave the comment only if it's not already present
if grep -q "$COMMENT" <(echo "$EXISTING_COMMENTS"); then
echo "Comment already exists, not posting again."
else
gh pr comment "$PR_URL" --body "$COMMENT"
fi
env:
GITHUB_TOKEN: ${{ github.token }}
verify_android:
name: Verify Android HybridApp builds on main
if: ${{ !github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/buildAndroid.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
variant: Release
secrets: inherit
verify_ios:
name: Verify iOS HybridApp builds on main
if: ${{ !github.event.pull_request.head.repo.fork && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/buildIOS.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
variant: Release
secrets: inherit