From 0d9d9a4d2ebfedda2609022bd9e8e3f5d2608b85 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 06:55:53 -0400 Subject: [PATCH 1/7] Cache build directory in CI --- .../continuous-integration-workflow.yml | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 9a1972461..22ecaf7f7 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -5,7 +5,7 @@ jobs: cpplint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-python@v1 - run: pip install cpplint - run: cpplint --recursive . @@ -25,9 +25,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: - submodules: recursive + submodules: recursive + + - name: Load Build Cache + uses: actions/cache@v2 + env: + cache-name: build-cache + with: + path: ./build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.0.0 @@ -35,7 +47,7 @@ jobs: - name: Run cmake run: | cd ${{ github.workspace }} - mkdir build + mkdir -p build cd build cmake .. -Dtest=ON @@ -101,10 +113,22 @@ jobs: node-version: 8 - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: submodules: recursive + - name: Load Build Cache + uses: actions/cache@v2 + env: + cache-name: build-cache + with: + path: ./build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Run cmake run: | cd ${{ github.workspace }} @@ -176,10 +200,22 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: submodules: recursive + - name: Load Build Cache + uses: actions/cache@v2 + env: + cache-name: build-cache + with: + path: ./build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Run cmake run: | cd ${{ github.workspace }} From 3980e75e59731c4f8da906de66bca480e85799b9 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 07:12:51 -0400 Subject: [PATCH 2/7] Update CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index d7c9a6652..5a52b8c39 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ Change Log ##### Additions :tada: * Switch CI builds to GitHub actions [#264](https://github.com/KhronosGroup/COLLADA2GLTF/pull/264) * Large-scale code cleanup and add cppcheck to CI to prevent backsliding [#265](https://github.com/KhronosGroup/COLLADA2GLTF/pull/265) +* Speed up CI build times [#189](https://github.com/KhronosGroup/COLLADA2GLTF/issues/189) ##### Fixes :wrench: * De-duplicate GLTF generated materials [#251](https://github.com/KhronosGroup/COLLADA2GLTF/issues/251) From fc94e0b4e632d02e628f4675355e85d954d80a14 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 07:18:01 -0400 Subject: [PATCH 3/7] Fix build build directory issues --- .github/workflows/continuous-integration-workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 22ecaf7f7..ee106dd54 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -47,7 +47,7 @@ jobs: - name: Run cmake run: | cd ${{ github.workspace }} - mkdir -p build + if not exist build mkdir build cd build cmake .. -Dtest=ON @@ -132,7 +132,7 @@ jobs: - name: Run cmake run: | cd ${{ github.workspace }} - mkdir build + mkdir -p build cd build cmake .. -Dtest=ON @@ -219,7 +219,7 @@ jobs: - name: Run cmake run: | cd ${{ github.workspace }} - mkdir build + mkdir -p build cd build cmake .. -Dtest=ON From dfc4d270bd14d568f1579121c3db879dda94d092 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 08:36:34 -0400 Subject: [PATCH 4/7] Clean up paths --- .../continuous-integration-workflow.yml | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index ee106dd54..c31a199db 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -34,11 +34,10 @@ jobs: env: cache-name: build-cache with: - path: ./build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} + path: ${{ github.workspace }}/build + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}- - name: Add msbuild to PATH @@ -47,7 +46,7 @@ jobs: - name: Run cmake run: | cd ${{ github.workspace }} - if not exist build mkdir build + mkdir build 2>NUL cd build cmake .. -Dtest=ON @@ -122,11 +121,10 @@ jobs: env: cache-name: build-cache with: - path: ./build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} + path: ${{ github.workspace }}/build + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}- - name: Run cmake @@ -209,11 +207,10 @@ jobs: env: cache-name: build-cache with: - path: ./build - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} + path: ${{ github.workspace }}/build + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}- - name: Run cmake From cb23ea39274660ba49d3937c77df64322a949650 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 09:49:59 -0400 Subject: [PATCH 5/7] Try to fix windows build --- .github/workflows/continuous-integration-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index c31a199db..b91df1cdc 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -46,7 +46,7 @@ jobs: - name: Run cmake run: | cd ${{ github.workspace }} - mkdir build 2>NUL + mkdir build /p cd build cmake .. -Dtest=ON From bf7cc94e0cbcef3ec7d3cc6e5f6a9b5164005e1f Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 10:22:47 -0400 Subject: [PATCH 6/7] Condition mkdir on cache hit --- .../continuous-integration-workflow.yml | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index b91df1cdc..a9a0a747d 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -29,24 +29,22 @@ jobs: with: submodules: recursive + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.0 + - name: Load Build Cache + id: cache uses: actions/cache@v2 env: cache-name: build-cache with: - path: ${{ github.workspace }}/build + path: build key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- - - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.0 - name: Run cmake - run: | - cd ${{ github.workspace }} - mkdir build /p + if: !steps.cache.outputs.cache-hit + - run: mkdir build + - run: | cd build cmake .. -Dtest=ON @@ -117,20 +115,18 @@ jobs: submodules: recursive - name: Load Build Cache + id: cache uses: actions/cache@v2 env: cache-name: build-cache with: - path: ${{ github.workspace }}/build + path: build key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- - name: Run cmake - run: | - cd ${{ github.workspace }} - mkdir -p build + if: !steps.cache.outputs.cache-hit + - run: mkdir build + - run: | cd build cmake .. -Dtest=ON @@ -203,20 +199,18 @@ jobs: submodules: recursive - name: Load Build Cache + id: cache uses: actions/cache@v2 env: cache-name: build-cache with: - path: ${{ github.workspace }}/build + path: build key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- - name: Run cmake - run: | - cd ${{ github.workspace }} - mkdir -p build + if: !steps.cache.outputs.cache-hit + - run: mkdir build + - run: | cd build cmake .. -Dtest=ON From 4bdc3c7194b1be556a98411d115f590ca11f6701 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Sat, 4 Jul 2020 10:24:53 -0400 Subject: [PATCH 7/7] Fix ordering for run steps --- .../workflows/continuous-integration-workflow.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index a9a0a747d..4a1a177a4 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -42,9 +42,8 @@ jobs: key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} - name: Run cmake - if: !steps.cache.outputs.cache-hit - - run: mkdir build - - run: | + run: | + if [ ! ${{ format('{0}', steps.cache.outputs.cache-hit) }} ]; then mkdir build fi cd build cmake .. -Dtest=ON @@ -124,9 +123,8 @@ jobs: key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} - name: Run cmake - if: !steps.cache.outputs.cache-hit - - run: mkdir build - - run: | + run: | + if [ ! ${{ format('{0}', steps.cache.outputs.cache-hit) }} ]; then mkdir build fi cd build cmake .. -Dtest=ON @@ -208,9 +206,8 @@ jobs: key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} - name: Run cmake - if: !steps.cache.outputs.cache-hit - - run: mkdir build - - run: | + run: | + if [ ! ${{ format('{0}', steps.cache.outputs.cache-hit) }} ]; then mkdir build fi cd build cmake .. -Dtest=ON