File tree Expand file tree Collapse file tree 3 files changed +57
-21
lines changed Expand file tree Collapse file tree 3 files changed +57
-21
lines changed Original file line number Diff line number Diff line change 32
32
-p swift-bridge-ir \
33
33
-p swift-bridge-macro \
34
34
-p swift-integration-tests
35
+
36
+ swift-package-test :
37
+ runs-on : macOS-11
38
+ timeout-minutes : 30
39
+
40
+ steps :
41
+ - uses : actions/checkout@v2
42
+
43
+ - uses : actions-rs/toolchain@v1
44
+ with :
45
+ toolchain : stable
46
+
47
+ - name : Add rust targets
48
+ run : rustup target add aarch64-apple-darwin x86_64-apple-darwin
49
+
50
+ - name : Run swift package tests
51
+ run : ./test-swift-packages.sh
35
52
36
53
integration-test :
37
54
runs-on : macOS-11
48
65
run : rustup target add aarch64-apple-darwin x86_64-apple-darwin
49
66
50
67
- name : Run integration tests
51
- run : ./test-integration.sh
68
+ run : ./test-swift-rust- integration.sh
52
69
53
70
build-examples :
54
71
runs-on : macOS-11
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Swift package tests
4
+
5
+ set -e
6
+
7
+ export RUSTFLAGS=" -D warnings"
8
+
9
+ # Change to the root directory of the Xcode project
10
+ cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd -P
11
+ THIS_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd -P )
12
+ ROOT_DIR=" $THIS_DIR "
13
+ cd $ROOT_DIR
14
+
15
+ # Make a temp directory
16
+ TEMP_DIR=$( mktemp -d)
17
+
18
+ # Delete the temp directory before the shell exits
19
+ trap ' rm -rf $TEMP_DIR' EXIT
20
+
21
+ # Copy directories related to all of the building and test running to the temp directory
22
+ for DIR in crates src examples SwiftRustIntegrationTestRunner
23
+ do
24
+ cp -r $DIR / $TEMP_DIR /$DIR
25
+ done
26
+ cp Cargo.toml $TEMP_DIR
27
+ cd $TEMP_DIR /SwiftRustIntegrationTestRunner
28
+
29
+ # Build Rust
30
+ mkdir -p swift-package-rust-library-fixture/generated
31
+
32
+ ./swift-package-rust-library-fixture/build.sh
33
+
34
+ # Create Swift Package
35
+ cargo run -p integration-test-create-swift-package
36
+
37
+ # Test Swift Package
38
+ cd swift-package-test-package
39
+ swift test
Original file line number Diff line number Diff line change @@ -12,26 +12,6 @@ ROOT_DIR="$THIS_DIR"
12
12
cd $ROOT_DIR
13
13
14
14
cd SwiftRustIntegrationTestRunner
15
-
16
- # Delete previous generated files/folders
17
- rm -r swift-package-rust-library-fixture/generated || true
18
- rm -r swift-package-rust-library-fixture/MySwiftPackage || true
19
- rm -r swift-package-rust-library-fixture/target || true
20
- rm -r swift-package-test-package/.build || true
21
-
22
- # Build Rust
23
- mkdir swift-package-rust-library-fixture/generated
24
-
25
- ./swift-package-rust-library-fixture/build.sh
26
-
27
- # Create Swift Package
28
- cargo run -p integration-test-create-swift-package
29
-
30
- # Test Swift Package
31
- cd swift-package-test-package
32
- swift test
33
- cd ..
34
-
35
15
# If project files don't exist before Xcode begins building we get something like:
36
16
# error: Build input file cannot be found: '/path/to/Generated/SwiftBridgeCore.swift'
37
17
# So.. here we create empty versions of the files that will get generated during the
You can’t perform that action at this time.
0 commit comments