-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (127 loc) · 4.3 KB
/
Copy pathpr-integrations.yml
File metadata and controls
147 lines (127 loc) · 4.3 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
### PR Integrations Workflow ###
#
# This workflow runs on pull requests and performs:
# - Danger checks
# - Unit Tests
# - Snapshot Tests
#
# Authentication:
# - `github.token` is automatically provided by GitHub.
#
# Notes:
# - To enable Fastlane tests, ensure `CommonFastfile` is imported in your Fastfile
# from the shared ios-fastlane repository.
# - By default, this workflow runs on every PR change. Be mindful of costs when
# using macos-latest. It can also be triggered manually in GitHub.
# - See more trigger options: https://help.github.com/en/actions/reference/events-that-trigger-workflows
#
# File: .github/workflows/pr-integrations.yml
name: Integrations (PR)
on:
workflow_dispatch:
pull_request:
types: [opened, edited, reopened, synchronize, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Common environment variables available to all jobs
env:
WORKSPACE: ChemexTimer.xcworkspace
TEST_SCHEME: ChemexTimer
DEVICES: "iPhone 13 Pro"
jobs:
# Quality Checks (Danger) Job
quality-checks:
name: Quality Checks
runs-on: [self-hosted, macOS, mobile-ci]
if: github.event.pull_request.draft == false
timeout-minutes: 20
steps:
# Checkout the Project Repository
- name: Checkout
uses: actions/checkout@v4
# Istall Mise (Dev env setup tool)
- name: Install Mise
uses: jdx/mise-action@v2
with:
install: true
cache: false # change to true when running on macos-latest instead of self-hosted
experimental: true
# Cache Dependencies
- name: Cache Dependencies
uses: ./.github/actions/cache-dependencies
# Install dependencies (run install script)
- name: Install Dependencies
run: ./setup.swift install
working-directory: iOS
# uncomment if you are using SwiftLint via SPM plugin
# Set SwiftLint version for Danger
# - name: Set SwiftLint version
# run: echo "SWIFTLINT_VERSION=$(cat ./.swiftlint-version)" >> $GITHUB_ENV
# Run Danger
- name: Run Danger
run: bundle exec danger --fail-on-errors=true
working-directory: iOS
env:
GITHUB_TOKEN: ${{ github.token }}
# Unit Tests Job
unit-tests:
name: Unit Tests
runs-on: [self-hosted, macOS, mobile-ci]
if: github.event.pull_request.draft == false
timeout-minutes: 20
steps:
# Checkout the Project Repository
- name: Checkout
uses: actions/checkout@v4
# Istall Mise (Dev env setup tool)
- name: Install Mise
uses: jdx/mise-action@v2
with:
install: true
cache: false # change to true when running on macos-latest instead of self-hosted
experimental: true
# Cache dependencies
- name: Cache Dependencies
uses: ./.github/actions/cache-dependencies
# Install dependencies (run install script)
- name: Install Dependencies
run: ./setup.swift install
working-directory: iOS
# Run Unit Tests
- name: Run Unit Tests
run: bundle exec fastlane tests without_dependencies:true
working-directory: iOS
env:
TEST_PLAN: UnitTestPlan
# Snapshot Tests Job
snapshot-tests:
name: Snapshot Tests
runs-on: [self-hosted, macOS, mobile-ci]
if: github.event.pull_request.draft == false
timeout-minutes: 20
continue-on-error: false # <-- red ❌ on failure (still non-blocking)
steps:
# Checkout the Project Repository
- name: Checkout
uses: actions/checkout@v4
# Istall Mise (Dev env setup tool)
- name: Install Mise
uses: jdx/mise-action@v2
with:
install: true
cache: false # change to true when running on macos-latest instead of self-hosted
experimental: true
# Cache dependencies
- name: Cache Dependencies
uses: ./.github/actions/cache-dependencies
# Install dependencies (run install script)
- name: Install Dependencies
run: ./setup.swift install
working-directory: iOS
# Run Snapshots Tests
- name: Run Snapshot tests
run: bundle exec fastlane tests without_dependencies:true
working-directory: iOS
env:
TEST_PLAN: SnapshotTestPlan