This repository has been archived by the owner on Dec 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (86 loc) · 3.06 KB
/
CI.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CACHED_DEPENDENCY_PATHS: ${{ github.workspace }}/Tuist/Dependencies
jobs:
prepare-dependency:
name: ⚙️ prepare for CI
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Tuist
run: curl -Ls https://install.tuist.io | bash
- name: Compute dependency cache key
id: compute_hash
run: echo "hash=${{ hashFiles('Tuist/Dependencies.swift') }}" >> $GITHUB_OUTPUT
- name: Check dependency cache
uses: actions/cache@v3
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ steps.compute_hash.outputs.hash }}
- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit == ''
run: tuist fetch
outputs:
dependency_cache_key: ${{ steps.compute_hash.outputs.hash }}
build:
name: 🏢 Build
env:
ENCRYPTED_GPLIST_FILE_PATH: ${{ 'iOS/Resources/GoogleService-Info.plist.gpg' }}
DECRYPTED_GPLIST_FILE_PATH: ${{ 'iOS/Resources/GoogleService-Info.plist' }}
GPLIST_PW: ${{ secrets.GOOGLE_SERVICE_ENCRYPTO_PW }}
runs-on: macos-latest
needs: prepare-dependency
steps:
- uses: actions/checkout@v2
with:
xcode-version: latest
- name: install tuist
run: curl -Ls https://install.tuist.io | bash
- name: configure GoogleService-Info.plist
run: |
gpg --pinentry-mode=loopback --passphrase "$GPLIST_PW" -d -o "$DECRYPTED_GPLIST_FILE_PATH" "$ENCRYPTED_GPLIST_FILE_PATH"
- name: Check dependency cache
uses: actions/cache@v3
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ needs.prepare-dependency.outputs.dependency_cache_key }}
- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: tuist fetch
- name: build tuist
run: TUIST_CI=1 tuist build
test:
name: 🧪 Test
env:
ENCRYPTED_GPLIST_FILE_PATH: ${{ 'iOS/Resources/GoogleService-Info.plist.gpg' }}
DECRYPTED_GPLIST_FILE_PATH: ${{ 'iOS/Resources/GoogleService-Info.plist' }}
GPLIST_PW: ${{ secrets.GOOGLE_SERVICE_ENCRYPTO_PW }}
runs-on: macos-latest
needs: prepare-dependency
steps:
- uses: actions/checkout@v2
with:
xcode-version: latest
- name: install tuist
run: curl -Ls https://install.tuist.io | bash
- name: configure GoogleService-Info.plist
run: |
gpg --pinentry-mode=loopback --passphrase "$GPLIST_PW" -d -o "$DECRYPTED_GPLIST_FILE_PATH" "$ENCRYPTED_GPLIST_FILE_PATH"
- name: Check dependency cache
uses: actions/cache@v3
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ needs.prepare-dependency.outputs.dependency_cache_key }}
- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: tuist fetch
- name: test tuist
run: TUIST_CI=1 tuist test