Skip to content

Commit 38287fa

Browse files
committed
Integrate GitHub Actions
1 parent 89b6736 commit 38287fa

2 files changed

Lines changed: 143 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "validator"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
paths:
10+
- '.swiftlint.yml'
11+
branches:
12+
- main
13+
- dev
14+
15+
concurrency:
16+
group: ci
17+
cancel-in-progress: true
18+
19+
jobs:
20+
SwiftLint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: GitHub Action for SwiftLint
25+
uses: norio-nomura/action-swiftlint@3.2.1
26+
with:
27+
args: --strict
28+
env:
29+
DIFF_BASE: ${{ github.base_ref }}
30+
Old:
31+
name: Test Old (iOS, macOS, tvOS, watchOS)
32+
runs-on: macOS-11
33+
env:
34+
DEVELOPER_DIR: "/Applications/Xcode_13.2.app/Contents/Developer"
35+
timeout-minutes: 10
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- destination: "OS=13.1,name=iPhone 12 Pro"
41+
name: "iOS"
42+
scheme: "Validator-Package"
43+
sdk: iphonesimulator
44+
- destination: "OS=13.1,name=Apple TV"
45+
name: "tvOS"
46+
scheme: "Validator-Package"
47+
sdk: appletvsimulator
48+
- destination: "OS=7,name=Apple Watch Series 6 (40mm)"
49+
name: "watchOS"
50+
scheme: "Validator-Package"
51+
sdk: watchsimulator
52+
- destination: "platform=macOS"
53+
name: "macOS"
54+
scheme: "Validator-Package"
55+
sdk: macosx
56+
steps:
57+
- uses: actions/checkout@v3
58+
- name: ${{ matrix.name }}
59+
run: xcodebuild test -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean | xcpretty
60+
Latest:
61+
name: Test Latest (iOS, macOS, tvOS, watchOS)
62+
runs-on: macOS-12
63+
env:
64+
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
65+
timeout-minutes: 10
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
include:
70+
- destination: "OS=16.1,name=iPhone 14 Pro"
71+
name: "iOS"
72+
scheme: "Validator-Package"
73+
sdk: iphonesimulator
74+
- destination: "OS=16.1,name=Apple TV"
75+
name: "tvOS"
76+
scheme: "Validator-Package"
77+
sdk: appletvsimulator
78+
- destination: "OS=9.1,name=Apple Watch Series 8 (45mm)"
79+
name: "watchOS"
80+
scheme: "Validator-Package"
81+
sdk: watchsimulator
82+
- destination: "platform=macOS"
83+
name: "macOS"
84+
scheme: "Validator-Package"
85+
sdk: macosx
86+
steps:
87+
- uses: actions/checkout@v3
88+
- name: ${{ matrix.name }}
89+
run: xcodebuild test -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "./${{ matrix.sdk }}.xcresult" | xcpretty -r junit
90+
- name: Upload coverage reports to Codecov
91+
uses: codecov/codecov-action@v3.1.0
92+
with:
93+
token: ${{ secrets.CODECOV_TOKEN }}
94+
xcode: true
95+
xcode_archive_path: "./${{ matrix.sdk }}.xcresult"

codecov.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
codecov:
2+
# Require CI to pass to show coverage, default yes
3+
require_ci_to_pass: yes
4+
notify:
5+
# Codecov should wait for all CI statuses to complete, default yes
6+
wait_for_ci: yes
7+
8+
coverage:
9+
# Coverage precision range 0-5, default 2
10+
precision: 2
11+
12+
# Direction to round the coverage value - up, down, nearest, default down
13+
round: nearest
14+
15+
# Value range for red...green, default 70...100
16+
range: "70...90"
17+
18+
status:
19+
# Overall project coverage, compare against pull request base
20+
project:
21+
default:
22+
# The required coverage value
23+
target: 50%
24+
25+
# The leniency in hitting the target. Allow coverage to drop by X%
26+
threshold: 5%
27+
28+
# Only measure lines adjusted in the pull request or single commit, if the commit in not in the pr
29+
patch:
30+
default:
31+
# The required coverage value
32+
target: 85%
33+
34+
# Allow coverage to drop by X%
35+
threshold: 5%
36+
changes: no
37+
38+
comment:
39+
# Pull request Codecov comment format.
40+
# diff: coverage diff of the pull request
41+
# files: a list of files impacted by the pull request (coverage changes, file is new or removed)
42+
layout: "diff, files"
43+
44+
# Update Codecov comment, if exists. Otherwise post new
45+
behavior: default
46+
47+
# If true, only post the Codecov comment if coverage changes
48+
require_changes: false

0 commit comments

Comments
 (0)