Skip to content

Commit

Permalink
Set up GitHub Actions CI (#1623)
Browse files Browse the repository at this point in the history
GitHub Actions now supports CI and it's free for open source projects!

Our current CI runs on a single machine and needs 1h 20m for each build. GitHub CI often finishes everything in less than 10m!

The setup is straight-forward. The only missing feature is the ability to exclude certain files so that if a commit only contains those files, the CI won't test it at all (see exclude-from-build.json). Given that GitHub CI is fast and is not a serial queue, I wouldn't mind testing such commit as well.

* Fix and optimize steps that build example projects

- examples-pt3 builds the same examples as examples-pt1 instead of building the remaining projects. So I fixed it.
- Add another mode (examples-pt4) to distribute the load with existing steps.
- Build extra examples (examples-extra-pt{1, 2, 3}) which weren't built before.
- Each examples-pt and examples-extra-pt builds 5 projects except examples-pt4 and examples-extra-pt3 which build 6.

* Use HTTPS URL for Weaver in Podfile of examples/ASDKgram

* Don't build extra examples for now
  • Loading branch information
nguyenhuy committed Aug 18, 2019
1 parent ab0a14c commit 33c4b05
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci-master-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI (master-only jobs)

on:
push:
branches:
- master

jobs:
cocoapods-lint:
name: Verify that podspec lints
runs-on: macOS-10.14
steps:
- name: Checkout the Git repository
uses: actions/checkout@v1
- name: Run build.sh with cocoapods-lint mode
run: ./build.sh cocoapods-lint
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on: push

jobs:
buildsh:
strategy:
matrix:
mode: [tests, framework, life-without-cocoapods, carthage, examples-pt1, examples-pt2, examples-pt3, examples-pt4]
include:
- mode: tests
name: Build and run tests
- mode: framework
name: Build Texture as a dynamic framework
- mode: life-without-cocoapods
name: Build Texture as a static library
- mode: carthage
name: Verify that Carthage works
- mode: examples-pt1
name: Build examples (examples-pt1)
- mode: examples-pt2
name: Build examples (examples-pt2)
- mode: examples-pt3
name: Build examples (examples-pt3)
- mode: examples-pt4
name: Build examples (examples-pt4)
name: ${{ matrix.name }}
runs-on: macOS-10.14
steps:
- name: Checkout the Git repository
uses: actions/checkout@v1
- run: ./build.sh ${{ matrix.mode }}
57 changes: 48 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ if [ "$MODE" = "examples-pt1" ]; then
#Update cocoapods repo
pod repo update master

for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -6 | head); do
echo "Building (examples-pt1) $example."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -6); do
echo "Building (examples-pt1) $example"

build_example $example
done
Expand All @@ -123,8 +123,8 @@ if [ "$MODE" = "examples-pt2" ]; then
#Update cocoapods repo
pod repo update master

for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -12 | tail -6 | head); do
echo "Building $example (examples-pt2)."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -11 | tail -5); do
echo "Building (examples-pt2) $example"

build_example $example
done
Expand All @@ -136,21 +136,60 @@ if [ "$MODE" = "examples-pt3" ]; then
#Update cocoapods repo
pod repo update master

for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -7 | head); do
echo "Building $example (examples-pt3)."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -16 | tail -5); do
echo "Building (examples-pt3) $example"

build_example $example
done
success="1"
fi

if [ "$MODE" = "examples-extra" ]; then
if [ "$MODE" = "examples-pt4" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
#Update cocoapods repo
pod repo update master

for example in $((find ./examples_extra -type d -maxdepth 1 \( ! -iname ".*" \)) | head -7 | head); do
echo "Building $example (examples-extra)."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | tail -n +17); do
echo "Building (examples-pt4) $example"

build_example $example
done
success="1"
fi

if [ "$MODE" = "examples-extra-pt1" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
#Update cocoapods repo
pod repo update master

for example in $((find ./examples_extra -type d -maxdepth 1 \( ! -iname ".*" \)) | head -6); do
echo "Building (examples-extra-pt1) $example"

build_example $example
done
success="1"
fi

if [ "$MODE" = "examples-extra-pt2" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
#Update cocoapods repo
pod repo update master

for example in $((find ./examples_extra -type d -maxdepth 1 \( ! -iname ".*" \)) | head -11 | tail -5); do
echo "Building (examples-extra-pt2) $example"

build_example $example
done
success="1"
fi

if [ "$MODE" = "examples-extra-pt3" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
#Update cocoapods repo
pod repo update master

for example in $((find ./examples_extra -type d -maxdepth 1 \( ! -iname ".*" \)) | tail -n +12); do
echo "Building (examples-extra-pt3) $example"

build_example $example
done
Expand Down
2 changes: 1 addition & 1 deletion examples/ASDKgram/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ target 'Sample' do
pod 'Texture/PINRemoteImage', :path => '../..'
pod 'Texture/Yoga', :path => '../..'
pod 'Texture/Video', :path => '../..'
pod 'Weaver', :git => 'git@github.com:TextureGroup/Weaver.git', :branch => 'master'
pod 'Weaver', :git => 'https://github.com/TextureGroup/Weaver.git', :branch => 'master'
end

0 comments on commit 33c4b05

Please sign in to comment.