-
Notifications
You must be signed in to change notification settings - Fork 492
111 lines (93 loc) · 3.14 KB
/
continuous-integration.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
111
name: build
on:
push:
branches:
- main
- github-actions
- 'release-**'
pull_request:
branches:
- main
- github-actions
- 'release-**'
env:
# Expected to be used within scripts.
LANG: en_US.UTF-8
PACKAGE_TEST_DIRECTORY: "InstructionsPackageTest"
TEST_DIRECTORY: "Instructions"
# Wether or not to perform certain steps.
run_pod_lint: true
build_app_extension_example: true
run_tests: true
jobs:
test-package:
name: Check installation
runs-on: macos-13
steps:
- name: Switch Xcode version
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
- name: Check out test repository
uses: actions/checkout@v2
with:
repository: "ephread/InstructionsPackageTest"
path: ${{ env.PACKAGE_TEST_DIRECTORY }}
- name: Install test dependencies
working-directory: ./${{ env.PACKAGE_TEST_DIRECTORY }}
run: |
bundle install
- name: Test SwiftPM import
working-directory: ./${{ env.PACKAGE_TEST_DIRECTORY }}
run: |
bundle exec fastlane test_swiftpm
- name: Test CocoaPods import
working-directory: ./${{ env.PACKAGE_TEST_DIRECTORY }}
run: |
bundle exec fastlane test_cocoapods
- name: Test Carthage import
working-directory: ./${{ env.PACKAGE_TEST_DIRECTORY }}
run: |
bundle exec fastlane test_carthage
test:
name: Build, lint & test
runs-on: macos-13
steps:
- name: Switch Xcode version
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
- name: Check out the repository
uses: actions/checkout@v2
with:
path: ${{ env.TEST_DIRECTORY }}
- name: Install test dependencies
working-directory: ./${{ env.TEST_DIRECTORY }}
run: |
bundle install
- name: Run Cocoapods' linter
if: env.run_pod_lint == 'true'
working-directory: ./${{ env.TEST_DIRECTORY }}
# Warnings might be allowed in versions where Instructions
# continue to support deprecated methods.
run: |
if [ $ALLOW_WARNINGS == "YES" ]; then
pod lib lint --allow-warnings;
else
pod lib lint;
fi
- name: Run tests
if: env.run_tests == 'true'
working-directory: ./${{ env.TEST_DIRECTORY }}
run: |
bundle exec fastlane test_all
- name: Upload Failure Diffs
uses: actions/upload-artifact@v2
if: failure() && env.run_tests == 'true'
with:
name: FailureDiffs
path: "${{github.workspace}}/${{env.TEST_DIRECTORY}}/Examples/Example/Snapshot\ Tests/Supporting\ Files/Snapshots/FailureDiffs/"
- name: Convert and upload coverage
uses: paambaati/codeclimate-action@v2.6.0
if: env.run_tests == 'true'
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageCommand: "cd '${{env.TEST_DIRECTORY}}' && slather coverage -x --build-directory Build/"
coverageLocations: "${{github.workspace}}/${{env.TEST_DIRECTORY}}/Tests/cobertura.xml:cobertura"