From 2233d4c72c7118064660ef01e47c44c7ba63b04d Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 3 Jan 2019 10:46:22 -0700 Subject: [PATCH] Add jenkinsfile --- Jenkinsfile | 50 +++++++++++++++++++++++++++++++++++++++++++++ Makefile | 9 +++++--- fastlane/.gitignore | 3 +++ fastlane/Appfile | 6 ++++++ fastlane/Fastfile | 27 ++++++++++++++++++++++++ fastlane/Scanfile | 7 ------- 6 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 Jenkinsfile create mode 100644 fastlane/Appfile create mode 100644 fastlane/Fastfile delete mode 100644 fastlane/Scanfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..4d31c65c0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,50 @@ +pipeline { + agent any + + environment { + LANG = "en_US.UTF-8" + LANGUAGE = "en_US.UTF-8" + LC_ALL = "en_US.UTF-8" + PATH = "PATH=$HOME/.rbenv/bin:$HOME/.rbenv/shims:/usr/local/bin/:$PATH" + } + + stages { + stage('env setup') { + steps { + sh 'make setup' + } + } + stage('build dependencies') { + steps { + sh 'make dependencies' + } + } + stage('test') { + steps { + ansiColor('xterm') { + sh 'make test' + } + } + } + } + + post { + success { + script { + // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable + if (env.CHANGE_ID) { + def comment = pullRequest.comment("👍 Build PASSED commit: ${pullRequest.head}") + } + } + } + + failure { + script { + // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable + if (env.CHANGE_ID) { + def comment = pullRequest.comment("💥 Build FAILED commit: ${pullRequest.head}") + } + } + } + } +} diff --git a/Makefile b/Makefile index 782a06539..a9a0e6163 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,15 @@ XCODE_BUILD = xcrun xcodebuild -workspace $(SCHEME).xcworkspace -scheme $(SCHEME default: test -ci: dependencies test - update_dependencies: bundle exec pod update carthage update --platform iOS +setup: + rbenv install -s + gem install bundler + bundle install + dependencies: cd $(WORKING_DIR) && \ git submodule update --init @@ -27,7 +30,7 @@ build: dependencies $(XCODE_BUILD) build | xcpretty test: - bundle exec fastlane scan + bundle exec fastlane test clean: clean_carthage cd $(WORKING_DIR) && \ diff --git a/fastlane/.gitignore b/fastlane/.gitignore index 007b73ee6..54a42f915 100644 --- a/fastlane/.gitignore +++ b/fastlane/.gitignore @@ -1 +1,4 @@ +README.md test_output +report.xml + diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 000000000..180306309 --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,6 @@ +# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app +# apple_id("[[APPLE_ID]]") # Your Apple email address + + +# For more information about the Appfile, see: +# https://docs.fastlane.tools/advanced/#appfile diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 000000000..99a588575 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,27 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + +default_platform(:ios) + +platform :ios do + desc "Description of what the lane does" + lane :test do + run_tests( + workspace: "Signal.xcworkspace", + scheme: "Signal", + devices: ["iPhone SE"] + ) + end +end diff --git a/fastlane/Scanfile b/fastlane/Scanfile deleted file mode 100644 index a58da5440..000000000 --- a/fastlane/Scanfile +++ /dev/null @@ -1,7 +0,0 @@ -# For more information about this configuration visit -# https://github.com/fastlane/fastlane/tree/master/scan#scanfile - -workspace "Signal.xcworkspace" -scheme "Signal" -devices ["iPhone SE"] -