Add Github workflows CI
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
name: CI
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
SwiftLint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: SwiftLint
|
||||
uses: norio-nomura/action-swiftlint@3.1.0
|
||||
with:
|
||||
args: --strict
|
||||
|
||||
macOS:
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
XCODE_VERSION: ${{ '12.4' }}
|
||||
steps:
|
||||
- name: Select Xcode
|
||||
run: "sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app"
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Build and Run
|
||||
run: rake build[release]
|
||||
- name: Test
|
||||
run: rake test
|
||||
@@ -4,3 +4,4 @@
|
||||
/*.xcodeproj
|
||||
DerivedData
|
||||
/.swiftpm/
|
||||
releases
|
||||
@@ -1,32 +1,15 @@
|
||||
# encoding: utf-8
|
||||
require 'open-uri'
|
||||
require 'shellwords'
|
||||
|
||||
################################
|
||||
# Rake configuration
|
||||
################################
|
||||
|
||||
# Make sure environment is UTF-8 (CI sometimes thinks it's ASCII)
|
||||
ENV['LANG'] = 'en_US.UTF-8'
|
||||
ENV['LANGUAGE'] = 'en_US.UTF-8'
|
||||
ENV['LC_ALL'] = 'en_US.UTF-8'
|
||||
Encoding.default_external = Encoding::UTF_8
|
||||
Encoding.default_internal = Encoding::UTF_8
|
||||
|
||||
# Environment variables (you can override those by adding parameters
|
||||
# to task definitions in buildconf/tasks)
|
||||
CONFIG = ENV['CONFIG'] || 'debug'
|
||||
CI = !!ENV['TEAMCITY_VERSION']
|
||||
GIT_REF = ENV['GITHUB_REF']
|
||||
|
||||
# Paths
|
||||
DERIVED_DATA_DIR = File.join('.build').freeze
|
||||
RELEASES_ROOT_DIR = File.join('releases').freeze
|
||||
|
||||
EXECUTABLE_NAME = 'XCRemoteCache'
|
||||
EXECUTABLE_NAMES = ['xclibtool', 'xcpostbuild', 'xcprebuild', 'xcprepare', 'xcswiftc', 'xcld']
|
||||
SCHEME = 'XCRemoteCacheApp'
|
||||
TEST_SCHEME = 'XCRemoteCacheTests'
|
||||
PROJECT_NAME = 'XCRemoteCache'
|
||||
|
||||
SWIFTLINT_ENABLED = true
|
||||
@@ -58,7 +41,7 @@ end
|
||||
desc 'build package artifacts'
|
||||
task :build, [:configuration, :sdks] do |task, args|
|
||||
# Set task defaults
|
||||
args.with_defaults(:configuration => CONFIG.downcase, :sdks => ['macos'])
|
||||
args.with_defaults(:configuration => 'debug', :sdks => ['macos'])
|
||||
|
||||
unless args.configuration == 'Debug'.downcase || args.configuration == 'Release'.downcase
|
||||
fail("Unsupported configuration. Valid values: ['Debug', 'Release']. Found '#{args.configuration}''")
|
||||
|
||||
Reference in New Issue
Block a user