From 05d62c66b0d79e6131cfcc85a68e5b2e33304509 Mon Sep 17 00:00:00 2001 From: "Steffen D. Sommer" Date: Thu, 28 Dec 2017 11:58:05 +0100 Subject: [PATCH] Align CI --- .circleci/config.yml | 66 +++++++++++++++++++++++++++++++++++++------- .codebeatignore | 2 ++ .swiftlint.yml | 12 ++++++++ .travis.yml | 23 --------------- LICENSE | 2 +- README.md | 7 ++--- 6 files changed, 74 insertions(+), 38 deletions(-) create mode 100644 .codebeatignore create mode 100644 .swiftlint.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 57131ae..7c4b39c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,19 +1,65 @@ +version: 2 jobs: - build: - docker: - - image: buildpack-deps:trusty + MacOS: + macos: + xcode: "9.0" steps: - checkout + - restore_cache: + keys: + - v1-spm-deps-{{ checksum "Package.swift" }} - run: - name: Install Swift - command: 'eval "$(curl -sL https://apt.vapor.sh)"' + name: Install CMySQL and CTLS + command: | + brew tap vapor/homebrew-tap + brew install cmysql + brew install ctls - run: - name: Install Vapor toolbox + name: Build and Run Tests + no_output_timeout: 1800 command: | - sudo apt-get install --yes vapor - sudo apt-get install --yes cmysql - sudo chmod -R a+rx /usr/ + swift package generate-xcodeproj --enable-code-coverage + xcodebuild -scheme Gatekeeper-Package -enableCodeCoverage YES test | xcpretty - run: - name: Run Tests + name: Report coverage to Codecov + command: | + bash <(curl -s https://codecov.io/bash) + - save_cache: + key: v1-spm-deps-{{ checksum "Package.swift" }} + paths: + - .build + Linux: + docker: + - image: brettrtoomey/vapor-ci:0.0.1 + steps: + - checkout + - restore_cache: + keys: + - v2-spm-deps-{{ checksum "Package.swift" }} + - run: + name: Copy Package file + command: cp Package.swift res + - run: + name: Build and Run Tests + no_output_timeout: 1800 command: | swift test -Xswiftc -DNOJSON + - run: + name: Restoring Package file + command: mv res Package.swift + - save_cache: + key: v2-spm-deps-{{ checksum "Package.swift" }} + paths: + - .build +workflows: + version: 2 + build-and-test: + jobs: + - MacOS + - Linux +experimental: + notify: + branches: + only: + - master + - develop diff --git a/.codebeatignore b/.codebeatignore new file mode 100644 index 0000000..2d9084a --- /dev/null +++ b/.codebeatignore @@ -0,0 +1,2 @@ +Public/** +Resources/Assets/** diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..1e79593 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,12 @@ +included: + - Sources +function_body_length: + warning: 60 +variable_name: + min_length: + warning: 2 +line_length: 80 +disabled_rules: + - opening_brace +colon: + flexible_right_spacing: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 228ec4c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -os: - - osx - -language: swift -sudo: required -osx_image: xcode8.3 - -before_install: - brew tap vapor/tap; - brew update; - brew install vapor; - brew install cmysql; - gem install xcpretty; - -script: - - set -o pipefail - - swift build - - swift build -c release - - swift package generate-xcodeproj --enable-code-coverage - - xcodebuild -scheme Gatekeeper -enableCodeCoverage YES test | xcpretty - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/LICENSE b/LICENSE index 7272564..1ced862 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Nodes Vapor +Copyright (c) 2017-2018 Nodes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ba88fcf..7b60074 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # Gatekeeper 👮 -[![Swift Version](https://img.shields.io/badge/Swift-3.1-brightgreen.svg)](http://swift.org) +[![Swift Version](https://img.shields.io/badge/Swift-3-brightgreen.svg)](http://swift.org) [![Vapor Version](https://img.shields.io/badge/Vapor-2-F6CBCA.svg)](http://vapor.codes) -[![Linux Build Status](https://img.shields.io/circleci/project/github/nodes-vapor/gatekeeper.svg?label=Linux)](https://circleci.com/gh/nodes-vapor/gatekeeper) -[![macOS Build Status](https://img.shields.io/travis/nodes-vapor/gatekeeper.svg?label=macOS)](https://travis-ci.org/nodes-vapor/gatekeeper) -[![codebeat badge](https://codebeat.co/badges/52c2f960-625c-4a63-ae63-52a24d747da1)](https://codebeat.co/projects/github-com-nodes-vapor-gatekeeper) +[![Circle CI](https://circleci.com/gh/nodes-vapor/gatekeeper/tree/master.svg?style=shield)](https://circleci.com/gh/nodes-vapor/gatekeeper) +[![codebeat badge](https://codebeat.co/badges/35c7b0bb-1662-44ae-b953-ab1d4aaf231f)](https://codebeat.co/projects/github-com-nodes-vapor-gatekeeper-master) [![codecov](https://codecov.io/gh/nodes-vapor/gatekeeper/branch/master/graph/badge.svg)](https://codecov.io/gh/nodes-vapor/gatekeeper) [![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=https://github.com/nodes-vapor/gatekeeper)](http://clayallsopp.github.io/readme-score?url=https://github.com/nodes-vapor/gatekeeper) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nodes-vapor/gatekeeper/master/LICENSE)