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

Add caching bazel output to speed up builds. #703

Closed
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
37 changes: 33 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
run_build_and_tests: ${{ steps.step1.outputs.run_build_and_tests }}

steps:
- uses: actions/checkout@v2
- name: Check If We Need to Run Build/Test
Expand Down Expand Up @@ -58,9 +57,19 @@ jobs:
needs: [preqs]
if: needs.preqs.outputs.run_build_and_tests == 'true'
steps:
- uses: actions/checkout@v2
- name: Build Userspace
run: bazel build --apple_generate_dsym -c opt :release --define=SANTA_BUILD_TYPE=ci
- name: Cache bazel output
uses: actions/cache@v2
env:
cache-name: bazel-cache
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}
- uses: actions/checkout@v2
- name: Build Userspace
run: bazel build --apple_generate_dsym -c opt :release --define=SANTA_BUILD_TYPE=ci

unit_tests:
strategy:
Expand All @@ -71,6 +80,16 @@ jobs:
needs: [preqs]
if: needs.preqs.outputs.run_build_and_tests == 'true'
steps:
- name: Cache bazel output
uses: actions/cache@v2
env:
cache-name: bazel-cache
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}
- uses: actions/checkout@v2
- name: Run All Tests
run: bazel test :unit_tests --define=SANTA_BUILD_TYPE=ci --test_output=errors
Expand All @@ -80,6 +99,16 @@ jobs:
needs: [preqs]
if: needs.preqs.outputs.run_build_and_tests == 'true'
steps:
- name: Cache bazel output
uses: actions/cache@v2
env:
cache-name: bazel-cache
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}
- uses: actions/checkout@v2
- name: Generate test coverage
run: sh ./generate_cov.sh
Expand Down