Преглед изворни кода

Merge pull request #448 from httpswift/gitHub-actions

Migrate to use Github Actions instead of CircleCI
Victor Sigler пре 6 година
родитељ
комит
e9b1d5ef5a

+ 0 - 82
.circleci/config.yml

@@ -1,82 +0,0 @@
-version: 2
-
-jobs:
-
-  Danger:
-    macos:
-      xcode: 11.1.0
-    steps:
-      - checkout
-      - run:
-          name: Set Ruby Version
-          command: echo "ruby-2.5.6" > ~/.ruby-version
-      - restore_cache:
-            key: 1-gems-{{ checksum "Gemfile.lock" }}
-      - run:
-          name: Install Ruby Dependencies
-          command: bundle check || bundle install
-          environment:
-            BUNDLE_JOBS: 4
-            BUNDLE_RETRY: 3
-      - save_cache:
-            key: 1-gems-{{ checksum "Gemfile.lock" }}
-            paths:
-              - vendor/bundle
-      - run:
-          name: Danger
-          command: bundle exec danger
-
-  Test OS X Platform:
-    environment:
-      TEST_REPORTS: /tmp/test-results
-      LANG: en_US.UTF-8
-    macos:
-      xcode: 11.1.0
-    steps:
-      - checkout
-      - run: 
-         name: Create Test Result Directory
-         command: mkdir -p $TEST_REPORTS
-      - run: 
-         name: Run Unit Test - macOS
-         command: |
-            cd XCode
-            set -o pipefail && xcodebuild test -scheme SwifterMac -sdk macosx -destination "arch=x86_64" | xcpretty -c -r html --output $TEST_REPORTS/macOS.html
-      - run: 
-         name: Run Unit Test - iOS
-         command: |
-            cd XCode
-            set -o pipefail && xcodebuild test -scheme SwifteriOS -sdk iphonesimulator -destination "name=iPhone 8" | xcpretty -c -r html --output $TEST_REPORTS/iOS.html
-      - run: 
-         name: Run Unit Test - tvOS
-         command: |
-            cd XCode
-            set -o pipefail && xcodebuild test -scheme SwiftertvOS -sdk appletvsimulator -destination "name=Apple TV 4K (at 1080p)" | xcpretty -c -r html --output $TEST_REPORTS/tvOS.html
-      - run:
-          name: Run Unit Test - Swift Package Manager
-          command: |
-             cd XCode
-             swift build && swift test
-      - store_artifacts:
-          path: /tmp/test-results
-
-  Test Linux Platform:
-    docker:
-      - image: swift:5.0
-    steps:
-      - checkout
-      - run: 
-          name: Run Unit Tests
-          command: swift test
-
-workflows:
-  version: 2
-  tests:
-    jobs:
-      - Danger
-      - Test Linux Platform:
-          requires:
-            - Danger
-      - Test OS X Platform:
-          requires:
-            - Danger

+ 32 - 0
.github/workflows/danger.yml

@@ -0,0 +1,32 @@
+name: Danger
+on:
+  pull_request:
+    branches:
+        - stable
+
+jobs:
+  Danger:
+    runs-on: macos-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Cache Bundle Dependencies
+        uses: actions/cache@v1
+        with:
+          path: vendor/bundle
+          key: 1-gems-{{ checksum "Gemfile.lock" }}
+          restore-keys: 1-gems-
+      - name: Set Ruby Version
+        uses: actions/setup-ruby@v1
+        with:
+            ruby-version: 2.6
+      - name: Install Ruby Dependencies
+        run: |
+            bundle config path vendor/bundle
+            bundle check || bundle install
+        env:
+          BUNDLE_JOBS: 4
+          BUNDLE_RETRY: 3
+      - name: Running Danger
+        run: bundle exec danger
+        env:
+          DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}

+ 16 - 0
.github/workflows/linux-tests.yml

@@ -0,0 +1,16 @@
+name: Test Linux Platform
+on:
+  pull_request:
+    branches:
+        - stable
+
+jobs:
+  Test-Linux-Platform:
+    runs-on: ubuntu-latest
+    container:
+      image: swift:5.2
+      options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined
+    steps:
+      - uses: actions/checkout@v2
+      - name: Run Unit Tests
+        run: swift test

+ 39 - 0
.github/workflows/macos-tests.yml

@@ -0,0 +1,39 @@
+name: Test OS X Platform
+on:
+  pull_request:
+    branches:
+        - stable
+
+jobs:
+  Test-OS-X-Platform:
+    runs-on: macos-latest
+    env:
+      TEST_REPORTS: /tmp/test-results
+      LANG: en_US.UTF-8
+  
+    steps:
+      - uses: actions/checkout@v2
+      - name: Create Test Result Directory
+        run: |
+            mkdir -p tmp/test-results/
+      - name: Run Unit Test - macOS
+        run: |
+            cd XCode
+            set -o pipefail && xcodebuild test -scheme SwifterMac -sdk macosx -destination "arch=x86_64" | xcpretty -c -r html --output $TEST_REPORTS/macOS.html
+      - name: Run Unit Test - iOS
+        run: |
+            cd XCode
+            set -o pipefail && xcodebuild test -scheme SwifteriOS -sdk iphonesimulator -destination "name=iPhone 8" | xcpretty -c -r html --output $TEST_REPORTS/iOS.html
+      - name: Run Unit Test - tvOS
+        run: |
+            cd XCode
+            set -o pipefail && xcodebuild test -scheme SwiftertvOS -sdk appletvsimulator -destination "name=Apple TV 4K (at 1080p)" | xcpretty -c -r html --output $TEST_REPORTS/tvOS.html
+      - name: Run Unit Test - Swift Package Manager
+        run: |
+            cd XCode
+            swift build && swift test
+      - name: Archive Test results
+        uses: actions/upload-artifact@v1
+        with:
+            name: test-results
+            path: tmp/test-results

+ 1 - 0
CHANGELOG.md

@@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file. Changes not
 - Use `swift_version` CocoaPods DSL. ([#425](https://github.com/httpswift/swifter/pull/425)) by [@dnkoutso](https://github.com/dnkoutso)
 - Use `swift_version` CocoaPods DSL. ([#425](https://github.com/httpswift/swifter/pull/425)) by [@dnkoutso](https://github.com/dnkoutso)
 - Fix compiler warnings in Socket+File.swift for iOS, tvOS, and Linux platforms by using `withUnsafeBytes` rather than `&` to get a scoped UnsafeRawPointer ([#445](https://github.com/httpswift/swifter/pull/445)) by [@kbongort](https://github.com/kbongort).
 - Fix compiler warnings in Socket+File.swift for iOS, tvOS, and Linux platforms by using `withUnsafeBytes` rather than `&` to get a scoped UnsafeRawPointer ([#445](https://github.com/httpswift/swifter/pull/445)) by [@kbongort](https://github.com/kbongort).
 - Fix tests on linux by importing FoundationNetworking for NSURLSession APIs. ([#446](https://github.com/httpswift/swifter/pull/446)) by [@kbongort](https://github.com/kbongort)
 - Fix tests on linux by importing FoundationNetworking for NSURLSession APIs. ([#446](https://github.com/httpswift/swifter/pull/446)) by [@kbongort](https://github.com/kbongort)
+- Replace CircleCI for continuous integration in favor of Github Actions. ([#446](https://github.com/httpswift/swifter/pull/446)) by [@Vkt0r](https://github.com/Vkt0r)
 
 
 # [1.4.7] 
 # [1.4.7] 
 
 

+ 1 - 1
XCode/Tests/ServerThreadingTests.swift

@@ -29,7 +29,7 @@ class ServerThreadingTests: XCTestCase {
         super.tearDown()
         super.tearDown()
     }
     }
 
 
-    func testShouldHandleTheSameRequestWithDifferentTimeIntervals() {
+    func testShouldHandleTheRequestInDifferentTimeIntervals() {
 
 
         let path = "/a/:b/c"
         let path = "/a/:b/c"
         let queue = DispatchQueue(label: "com.swifter.threading")
         let queue = DispatchQueue(label: "com.swifter.threading")

+ 1 - 1
XCode/Tests/XCTestManifests.swift

@@ -27,8 +27,8 @@ extension ServerThreadingTests {
     //   `swift test --generate-linuxmain`
     //   `swift test --generate-linuxmain`
     // to regenerate.
     // to regenerate.
     static let __allTests__ServerThreadingTests = [
     static let __allTests__ServerThreadingTests = [
+        ("testShouldHandleTheRequestInDifferentTimeIntervals", testShouldHandleTheRequestInDifferentTimeIntervals),
         ("testShouldHandleTheSameRequestConcurrently", testShouldHandleTheSameRequestConcurrently),
         ("testShouldHandleTheSameRequestConcurrently", testShouldHandleTheSameRequestConcurrently),
-        ("testShouldHandleTheSameRequestWithDifferentTimeIntervals", testShouldHandleTheSameRequestWithDifferentTimeIntervals),
     ]
     ]
 }
 }