Skip to content

Commit c85b568

Browse files
committed
add Tests workflow
1 parent a58a351 commit c85b568

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

.github/scripts/tests.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
ARCH=""
4+
5+
if [ $1 = "arm" ]
6+
then
7+
ARCH="arm64"
8+
else
9+
ARCH="x86_64"
10+
fi
11+
12+
echo "Building with arch: ${ARCH}"
13+
14+
export LC_CTYPE=en_US.UTF-8
15+
16+
set -o pipefail && arch -"${ARCH}" xcodebuild \
17+
-scheme CodeEditKit \
18+
-derivedDataPath ".build" \
19+
-destination "platform=macos,arch=${ARCH}" \
20+
clean test | xcpretty

.github/workflows/tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: tests
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
paths:
7+
- 'Sources/**'
8+
- 'Tests/**'
9+
pull_request:
10+
branches:
11+
- 'main'
12+
jobs:
13+
code-edit-text-view-tests:
14+
name: Testing CodeEditTextView
15+
runs-on: macos-12
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v1
19+
- uses: actions/cache@v3
20+
with:
21+
path: '.build'
22+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
23+
restore-keys: |
24+
${{ runner.os }}-spm-
25+
- name: Make executeable
26+
run: chmod +x ./.github/scripts/tests.sh
27+
- name: Testing Package
28+
run: exec ./.github/scripts/tests.sh

Tests/CodeEditKitTests/CEExtensionKitTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import XCTest
33

44
final class CEExtensionKitTests: XCTestCase {
55
func testExample() throws {
6-
// This is an example of a functional test case.
7-
// Use XCTAssert and related functions to verify your tests produce the correct
8-
// results.
6+
XCTAssertTrue(true)
97
}
108
}

0 commit comments

Comments
 (0)