Skip to content

Commit

Permalink
Refactor sanitizer CI (#344)
Browse files Browse the repository at this point in the history
Remove Ubuntu 20.04 fromm the Asan workflow and introduce caching.
Sanitized builds require a large cache, making multi-os checks
infeasible at the moment.
  • Loading branch information
aaronmondal committed Oct 27, 2023
1 parent 9173c2f commit ce64cc2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/main.yml
Expand Up @@ -142,38 +142,3 @@ jobs:

- name: Run tests
run: ./run_integration_tests.sh

asan-tests:
# The type of runner that the job will run on.
runs-on: ubuntu-22.04
strategy:
matrix:
# Which OS versions we will test on.
os_version: [ 20.04, 22.04 ]
steps:
- uses: actions/checkout@v3.5.3
with:
fetch-depth: 0

- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
context: .
file: ./deployment-examples/docker-compose/Dockerfile
build-args: |
OS_VERSION=${{ matrix.os_version }}
load: true # This brings the build into `docker images` from buildx.
tags: allada/turbo-cache:asan-test
target: dependencies

- name: Bazel test
run: |
docker run \
-e TURBO_CACHE_DIR=/tmp/turbo-cache \
--rm \
-w /root/turbo-cache \
-v $PWD:/root/turbo-cache \
allada/turbo-cache:asan-test \
bazel test \
--config=asan \
//...
37 changes: 37 additions & 0 deletions .github/workflows/sanitizers.yaml
@@ -0,0 +1,37 @@
---
name: Sanitizers

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions: read-all

jobs:
sanitized-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
sanitizer: [asan]
name: ${{ matrix.sanitizer }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: >- # Custom commit at 2023-10-23
bazelbuild/setup-bazelisk@5bc144ec07bd24eaa9b5c3e8c9af4006b033b629
- name: Mount bazel cache
uses: >- # v3.3.2
actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: ~/.cache/bazel
key: ${{ matrix.os }}-bazel-${{ matrix.sanitizer }}

- name: Run Bazel tests
run: bazel test --config=${{ matrix.sanitizer }} //...
shell: bash

0 comments on commit ce64cc2

Please sign in to comment.