Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Android CI

on: [push]

jobs:
build:

runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Install Swift toolchain 5.0.3
run: wget https://swift.org/builds/swift-5.0.3-release/xcode/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-osx.pkg;
sudo installer -pkg swift-5.0.3-RELEASE-osx.pkg -target /
- name: Install NDK
run: wget https://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip;
unzip android-ndk-r17c-darwin-x86_64.zip
- name: Install Swift Android Toolchain
run: SWIFT_ANDROID=$(curl -fsSL https://api.bintray.com/packages/readdle/swift-android-toolchain/swift-android-toolchain/versions/_latest | python -c 'import json,sys;print(json.load(sys.stdin))["name"]');
wget https://dl.bintray.com/readdle/swift-android-toolchain/swift-android-$SWIFT_ANDROID.zip;
unzip swift-android-$SWIFT_ANDROID.zip;
swift-android-$SWIFT_ANDROID/bin/swift-android tools --update;
ln -sfn swift-android-$SWIFT_ANDROID swift-android-current
- name: Download Android Emulator
run: $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-29;google_apis;x86_64"
- name: Create Android Emulator
run: $ANDROID_HOME/tools/bin/avdmanager create avd -n ci-test -k "system-images;android-29;google_apis;x86_64" -d "pixel"
- name: Start Android Emulator
run: $ANDROID_HOME/emulator/emulator-headless -avd ci-test -noaudio > /dev/null &
- name: Run swift build for Android
run: export TOOLCHAINS=org.swift.50320190830a;
export ANDROID_NDK_HOME=$(pwd)/android-ndk-r17c;
export SWIFT_ANDROID_HOME=$(pwd)/swift-android-current;
export PATH=$ANDROID_NDK_HOME:$PATH;
export PATH=$SWIFT_ANDROID_HOME/bin:$SWIFT_ANDROID_HOME/build-tools/current:$PATH;
adb wait-for-device;
SWIFT_ANDROID_ARCH=x86_64 swift-test
17 changes: 17 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Public interface and LinuxMain checks

on: [push]

jobs:
build:

runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Generate new public interface
run: swift build -Xswiftc -emit-parseable-module-interface-path -Xswiftc AnyCodable.swiftinterface
- name: Generate LinuxMain
run: brew install sourcery; sourcery
- name: Check unstaged changes in git repo
run: git diff --exit-code
12 changes: 12 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Linux CI

on: [push]

jobs:
test:
runs-on: ubuntu-18.04
container: swift:latest
steps:
- uses: actions/checkout@v1
- name: Test
run: swift test
13 changes: 13 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: macOS CI

on: [push]

jobs:
build:

runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: test AnyCodable package
run: swift test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.build
LinuxMain.swift
21 changes: 21 additions & 0 deletions AnyCodable.swiftinterface
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// swift-interface-format-version: 1.0
// swift-tools-version: Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
// swift-module-flags: -target x86_64-apple-macosx10.10 -enable-objc-interop -swift-version 5 -Onone -module-name AnyCodable
import Foundation
public struct AnyCodable : Codable {
@_hasInitialValue public static var ArrayTypeName: Swift.String
@_hasInitialValue public static var SetTypeName: Swift.String
@_hasInitialValue public static var DictionaryTypeName: Swift.String
public static func RegisterType<T>(_ type: T.Type) where T : Decodable, T : Encodable
public let typeName: Swift.String
public let value: Any
@available(*, deprecated, renamed: "init(optionalValue:)", message: "Use explicit init(optionalValue:)")
public init?(value: Codable?) throws
public init?(optionalValue: Codable?) throws
public init(value: Codable) throws
public init(value: Swift.Array<Any>) throws
public init(value: Swift.Dictionary<Swift.AnyHashable, Any>) throws
public init(value: Swift.Set<Swift.AnyHashable>) throws
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}
21 changes: 21 additions & 0 deletions LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


import XCTest
@testable import AnyCodableTests

extension AnyCodableTests {
static var allTests = [
("testDictionary", testDictionary),
("testArray", testArray),
("testSet", testSet),
("testTwoDimensionalArray", testTwoDimensionalArray),
("testUnregistredEncodingDecoding", testUnregistredEncodingDecoding),
]
}


XCTMain([
testCase(AnyCodableTests.allTests),
])