From 9c07d940f5f4e266dfea939749064055ca0c254d Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Sat, 17 Aug 2019 06:06:48 -0700 Subject: [PATCH 1/6] Set up GitHub Actions CI --- .github/workflows/ci-master-only.yml | 14 ++++++++ .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/ci-master-only.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci-master-only.yml b/.github/workflows/ci-master-only.yml new file mode 100644 index 000000000..132a2f315 --- /dev/null +++ b/.github/workflows/ci-master-only.yml @@ -0,0 +1,14 @@ +name: CI (master-only jobs) + +on: + push: + branches: + - master + +jobs: + cocoapods-lint: + name: Verify that podspec lints + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh cocoapods-lint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..5637d651c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: push + +jobs: + tests: + name: Build and run tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh tests + dynamic-framework: + name: Build Texture as a dynamic framework + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh framework + static-library: + name: Build Texture as a static library + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh life-without-cocoapods + examples-pt1: + name: Build examples (examples-pt1) + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh examples-pt1 + examples-pt2: + name: Build examples (examples-pt2) + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh examples-pt2 + examples-pt3: + name: Build examples (examples-pt3) + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh examples-pt3 + carthage: + name: Verify that Carthage works + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh carthage From 1e3d7ffaf0a394cc73a281e11ba199c1abb1d81f Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Sat, 17 Aug 2019 10:13:47 -0700 Subject: [PATCH 2/6] 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. --- .github/workflows/ci.yml | 35 +++++++++++++++++++++--- build.sh | 57 +++++++++++++++++++++++++++++++++------- 2 files changed, 80 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5637d651c..984f85ba2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,13 @@ jobs: steps: - uses: actions/checkout@v1 - run: ./build.sh life-without-cocoapods + carthage: + name: Verify that Carthage works + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh carthage examples-pt1: name: Build examples (examples-pt1) needs: tests @@ -44,10 +51,32 @@ jobs: steps: - uses: actions/checkout@v1 - run: ./build.sh examples-pt3 - carthage: - name: Verify that Carthage works + examples-pt4: + name: Build examples (examples-pt4) needs: tests runs-on: macOS-10.14 steps: - uses: actions/checkout@v1 - - run: ./build.sh carthage + - run: ./build.sh examples-pt4 + examples-extra-pt1: + name: Build examples (examples-extra-pt1) + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh examples-extra-pt1 + examples-extra-pt2: + name: Build examples (examples-extra-pt2) + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh examples-extra-pt2 + examples-extra-pt3: + name: Build examples (examples-extra-pt3) + needs: tests + runs-on: macOS-10.14 + steps: + - uses: actions/checkout@v1 + - run: ./build.sh examples-extra-pt3 + \ No newline at end of file diff --git a/build.sh b/build.sh index 74fe48eb5..a58fc11fc 100755 --- a/build.sh +++ b/build.sh @@ -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 @@ -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 @@ -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 From 5ab106f9138887dd24e7701f93564cde48ef11ea Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Sat, 17 Aug 2019 10:39:35 -0700 Subject: [PATCH 3/6] Use HTTPS URL for Weaver in Podfile of examples/ASDKgram --- examples/ASDKgram/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ASDKgram/Podfile b/examples/ASDKgram/Podfile index 8611fa11f..69504e8ef 100644 --- a/examples/ASDKgram/Podfile +++ b/examples/ASDKgram/Podfile @@ -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 From 6f8d37885a6ebf8fff0e2286b2015d93eaaf7e6c Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Sat, 17 Aug 2019 10:41:44 -0700 Subject: [PATCH 4/6] Don't build extra examples for now --- .github/workflows/ci.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 984f85ba2..5a361549f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,25 +58,3 @@ jobs: steps: - uses: actions/checkout@v1 - run: ./build.sh examples-pt4 - examples-extra-pt1: - name: Build examples (examples-extra-pt1) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-extra-pt1 - examples-extra-pt2: - name: Build examples (examples-extra-pt2) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-extra-pt2 - examples-extra-pt3: - name: Build examples (examples-extra-pt3) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-extra-pt3 - \ No newline at end of file From 1c7d0b29a144e1df77cde505bb6b0a633234ef04 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Sat, 17 Aug 2019 15:05:09 -0700 Subject: [PATCH 5/6] Use strategy --- .github/workflows/ci.yml | 81 +++++++++++++--------------------------- 1 file changed, 26 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a361549f..277cab1cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,58 +3,29 @@ name: CI on: push jobs: - tests: - name: Build and run tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh tests - dynamic-framework: - name: Build Texture as a dynamic framework - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh framework - static-library: - name: Build Texture as a static library - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh life-without-cocoapods - carthage: - name: Verify that Carthage works - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh carthage - examples-pt1: - name: Build examples (examples-pt1) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-pt1 - examples-pt2: - name: Build examples (examples-pt2) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-pt2 - examples-pt3: - name: Build examples (examples-pt3) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-pt3 - examples-pt4: - name: Build examples (examples-pt4) - needs: tests - runs-on: macOS-10.14 - steps: - - uses: actions/checkout@v1 - - run: ./build.sh examples-pt4 + 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: + - uses: actions/checkout@v1 + - run: ./build.sh ${{ matrix.mode }} From d9893e688e73a761900ca8d55cbf02b426f7f1b4 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Sat, 17 Aug 2019 16:42:05 -0700 Subject: [PATCH 6/6] Pretty step names --- .github/workflows/ci-master-only.yml | 6 ++++-- .github/workflows/ci.yml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-master-only.yml b/.github/workflows/ci-master-only.yml index 132a2f315..dc78d17e9 100644 --- a/.github/workflows/ci-master-only.yml +++ b/.github/workflows/ci-master-only.yml @@ -10,5 +10,7 @@ jobs: name: Verify that podspec lints runs-on: macOS-10.14 steps: - - uses: actions/checkout@v1 - - run: ./build.sh cocoapods-lint + - name: Checkout the Git repository + uses: actions/checkout@v1 + - name: Run build.sh with cocoapods-lint mode + run: ./build.sh cocoapods-lint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 277cab1cb..57a36df68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,5 +27,6 @@ jobs: name: ${{ matrix.name }} runs-on: macOS-10.14 steps: - - uses: actions/checkout@v1 + - name: Checkout the Git repository + uses: actions/checkout@v1 - run: ./build.sh ${{ matrix.mode }}