Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlokhorst committed Nov 10, 2022
1 parent 96012a7 commit 26262e9
Show file tree
Hide file tree
Showing 12 changed files with 251 additions and 53 deletions.
57 changes: 32 additions & 25 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: '*'

env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.0.app/Contents/Developer

jobs:
unit-tests:
Expand All @@ -25,9 +25,9 @@ jobs:
- name: Test
run: swift test -v

test-iOS:
test-iOS-ResourceApp:
runs-on: macos-12
needs: build
needs: build-rswift
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -37,9 +37,9 @@ jobs:
name: rswift-dev
- name: Put build into place
run: |
mkdir -p build/Debug
mv rswift-dev/rswift build/Debug/rswift
chmod +x build/Debug/rswift
mkdir -p .build/release
mv rswift-dev/rswift .build/release/rswift
chmod +x .build/release/rswift
- name: Pull cache
uses: actions/cache@v2
id: podcache-ios
Expand All @@ -50,13 +50,13 @@ jobs:
${{ runner.os }}pods
- name: Install pods
if: steps.podcache-ios.outputs.cache-hit != 'true'
run: pod install --project-directory=Examples
run: pod install --project-directory=Examples/ResourceApp
- name: Test
run: fastlane scan --workspace "Examples/RswiftExamples.xcworkspace" --scheme "ResourceApp"
run: fastlane scan --workspace "Examples/ResourceApp/RswiftExamples.xcworkspace" --scheme "ResourceApp"

test-tvOS:
test-iOS-StaticFrameworks:
runs-on: macos-12
needs: build
needs: build-rswift
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -66,24 +66,31 @@ jobs:
name: rswift-dev
- name: Put build into place
run: |
mkdir -p build/Debug
mv rswift-dev/rswift build/Debug/rswift
chmod +x build/Debug/rswift
- name: Pull cache
uses: actions/cache@v2
id: podcache-tvos
mkdir -p .build/release
mv rswift-dev/rswift .build/release/rswift
chmod +x .build/release/rswift
- name: Test
run: fastlane scan --project "Examples/RswiftAppWithStaticFrameworks/RswiftAppWithStaticFrameworks.xcworkspace"

test-tvOS:
runs-on: macos-12
needs: build-rswift
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download build
uses: actions/download-artifact@v1
with:
path: Examples/Pods
key: ${{ runner.os }}pods${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}pods
- name: Install pods
if: steps.podcache-tvos.outputs.cache-hit != 'true'
run: pod install --project-directory=Examples
name: rswift-dev
- name: Put build into place
run: |
mkdir -p .build/release
mv rswift-dev/rswift .build/release/rswift
chmod +x .build/release/rswift
- name: Test
run: fastlane scan --workspace "Examples/RswiftExamples.xcworkspace" --scheme "ResourceApp-tvOS"
run: fastlane scan --project "Examples/RtvApp/RtvApp.xcodeproj"

build:
build-rswift:
runs-on: macos-12
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: created

env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.0.app/Contents/Developer

jobs:
release-build:
Expand Down
2 changes: 1 addition & 1 deletion Examples/ResourceApp/ResourceApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "../../.build/debug/rswift generate --imports SWRevealViewController \"$SRCROOT/R.generated.swift\" > \"$SRCROOT/rswift.log\"\n../../.build/debug/rswift generate \"$SRCROOT/R.UITest.generated.swift\" --generators id\n";
shellScript = "../../.build/release/rswift generate --imports SWRevealViewController \"$SRCROOT/R.generated.swift\" > \"$SRCROOT/rswift.log\"\n../../.build/release/rswift generate \"$SRCROOT/R.UITest.generated.swift\" --generators id\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
25 changes: 25 additions & 0 deletions Examples/RswiftAppWithStaticFrameworks/AppTests/AppTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// AppTests.swift
// AppTests
//
// Created by Tom Lokhorst on 2022-11-10.
//

import XCTest
@testable import Foo
@testable import Bar

final class AppTests: XCTestCase {

func testNotNil() throws {
let fooBundle = Bundle.main.path(forResource: "Foo", ofType: "bundle").flatMap(Bundle.init(path:))!
let barBundle = Bundle.main.path(forResource: "Bar", ofType: "bundle").flatMap(Bundle.init(path:))!

let fooR = Foo._R(bundle: fooBundle)
let barR = Bar._R(bundle: barBundle)

XCTAssertNotNil(UIImage(resource: fooR.image.user))
XCTAssertNotNil(UIImage(resource: barR.image.colorsJpg))
}

}
4 changes: 0 additions & 4 deletions Examples/RswiftAppWithStaticFrameworks/README.md

This file was deleted.

Loading

0 comments on commit 26262e9

Please sign in to comment.