Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to GitHub Actions 🤖 #233

Merged
merged 3 commits into from
May 10, 2021
Merged
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
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches:
- master
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- master

env:
# https://github.com/actions/virtual-environments/tree/main/images/macos
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer

WORKSPACE: Alicerce.xcworkspace
SCHEME: Alicerce

IOS_SDK: iphonesimulator
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest"

DERIVED_DATA_PATH: build

jobs:
env-details:
name: Environment details
runs-on: macOS-10.15
steps:
- name: xcode version
run: xcodebuild -version -sdk

- name: list simulators
run: |
xcrun simctl delete unavailable
xcrun simctl list

build-test:
name: Build and Test
runs-on: macOS-10.15
steps:
- name: git checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: unit tests
run: |
set -o pipefail
xcodebuild clean build test \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-sdk "$IOS_SDK" \
-destination "$IOS_DESTINATION" \
-derivedDataPath "$DERIVED_DATA_PATH" \
-enableCodeCoverage YES | xcpretty -c

- name: codecov upload
run: bash <(curl -s https://codecov.io/bash) -D $DERIVED_DATA_PATH -J "^$SCHEME$"
45 changes: 45 additions & 0 deletions .github/workflows/pod-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CocoaPods Lint

on:
push:
branches:
- master
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- master

env:
# https://github.com/actions/virtual-environments/tree/main/images/macos
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer

jobs:
main:
name: Pod Lint
runs-on: macOS-10.15
steps:
- name: git checkout
uses: actions/checkout@v2

- name: ruby versions
run: |
ruby --version
gem --version
bundler --version

- name: cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-

- name: bundle install
run: |
gem install bundler --no-document
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: pod lint
run: bundle exec pod lib lint
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
workflow_run:
workflows:
- CI
- SwiftPM Integration
- CocoaPods Lint
types:
- completed

jobs:
deploy-github:
name: Deploy Github
runs-on: macOS-10.15
if: startsWith(github.ref, 'refs/tags/') && ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: git checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Build Framework
run: |
carthage build --no-skip-current --cache-builds
carthage archive Alicerce

- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: Alicerce.framework.zip
body: |
# Changes

- <!-- Insert changes here -->

deploy-cocoapods:
name: Deploy CocoaPods
runs-on: macOS-10.15
if: startsWith(github.ref, 'refs/tags/') && ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: git checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: ruby versions
run: |
ruby --version
gem --version
bundler --version

- name: cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-

- name: bundle install
run: |
gem install bundler --no-document
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: pod trunk push --allow-warnings

31 changes: 31 additions & 0 deletions .github/workflows/spm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: SwiftPM Integration

on:
push:
branches:
- master
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- master

env:
# https://github.com/actions/virtual-environments/tree/main/images/macos
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer

PLATFORM_TARGET: x86_64-apple-ios14.0-simulator

jobs:
main:
name: SwiftPM Build
runs-on: macOS-10.15
steps:
- name: git checkout
uses: actions/checkout@v2

- name: xcode version
run: xcodebuild -version -sdk

- name: swift build
run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "${PLATFORM_TARGET}"
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions Alicerce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@
0A3C2CC21EA7E18500EFB7D4 /* Box.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Box.swift; sourceTree = "<group>"; };
0A3C2CC51EA7E18500EFB7D4 /* ServiceLocator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServiceLocator.swift; sourceTree = "<group>"; };
0A3C2D001EA7E1B500EFB7D4 /* .codecov.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .codecov.yml; sourceTree = "<group>"; };
0A3C2D011EA7E1B500EFB7D4 /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .travis.yml; sourceTree = "<group>"; };
0A3C2D021EA7E1B500EFB7D4 /* Alicerce.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Alicerce.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
0A3C2D041EA7E1B500EFB7D4 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
0A3C2D071EA7E1EE00EFB7D4 /* AlicerceTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AlicerceTests-Bridging-Header.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -554,6 +553,8 @@
0A9AF8BB1FC3242E0076458E /* SpecializedGenericTestView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SpecializedGenericTestView.xib; sourceTree = "<group>"; };
0A9AF8BF1FC336F60076458E /* ReusableViewTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReusableViewTestCase.swift; sourceTree = "<group>"; };
0A9AF8C11FC33B070076458E /* ReusableViewCollectionViewTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReusableViewCollectionViewTestCase.swift; sourceTree = "<group>"; };
0AA4EBA6264598AE00616FB3 /* .github */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .github; sourceTree = "<group>"; };
0AA4EBA72645E96900616FB3 /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile; sourceTree = "<group>"; };
0AB34A052085385A001F2979 /* UnfairLockTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnfairLockTestCase.swift; sourceTree = "<group>"; };
0AB34A0720853873001F2979 /* PthreadLockTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PthreadLockTestCase.swift; sourceTree = "<group>"; };
0ABFFAB91EA7F25B00CFC8BD /* Alicerce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Alicerce.h; path = Alicerce.xcodeproj/Alicerce.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -767,13 +768,14 @@
isa = PBXGroup;
children = (
0A3C2D041EA7E1B500EFB7D4 /* README.md */,
0AA4EBA6264598AE00616FB3 /* .github */,
0A933AB3244A2F3800AEBC07 /* .swiftlint.yml */,
0A3C2D011EA7E1B500EFB7D4 /* .travis.yml */,
0A3C2D001EA7E1B500EFB7D4 /* .codecov.yml */,
0A6A4D7524A5F98E0093F174 /* .swiftlint.yml */,
OBJ_6 /* Package.swift */,
0A3C2D021EA7E1B500EFB7D4 /* Alicerce.podspec */,
0A166EDC22107C1600EC6686 /* Brewfile */,
0AA4EBA72645E96900616FB3 /* Gemfile */,
0AFB453C251143ED00698CBB /* Documentation */,
);
name = Metadata;
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'cocoapods', '~> 1.10'
Loading