Remove redundant formatting script #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Controls when the workflow will run. | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
windows-tests: | |
# The type of runner that the job will run on. | |
runs-on: windows-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Compile on windows | |
run: cargo build --all | |
- name: Test on windows | |
run: cargo test --all | |
cargo-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/[email protected] | |
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:dependencies | |
target: dependencies | |
- name: Create container for cargo | |
run: | | |
docker run --name=turbo-cache-cargo allada/turbo-cache:dependencies bash -c ' \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y curl libssl-dev gcc pkg-config python3 && \ | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.70.0 \ | |
' && \ | |
docker commit turbo-cache-cargo allada/turbo-cache:cargo | |
- name: Check Cargo.toml is up to date | |
run: | | |
docker run --rm -w /root/turbo-cache -v $PWD:/root/turbo-cache allada/turbo-cache:cargo python3 ./tools/build_cargo_manifest.py && \ | |
git diff --exit-code || \ | |
(echo "Cargo.toml is out of date. Please run: python ./tools/build_cargo_manifest.py" && exit 1) | |
- name: Compile & test with cargo | |
run: | | |
docker run --rm -w /root/turbo-cache -v $PWD:/root/turbo-cache allada/turbo-cache:cargo bash -c ' \ | |
. /root/.cargo/env && \ | |
cargo build --all && \ | |
cargo test --all \ | |
' | |
unit-test: | |
# 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/[email protected] | |
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: | | |
OPT_LEVEL=fastbuild | |
OS_VERSION=${{ matrix.os_version }} | |
load: true # This brings the build into `docker images` from buildx. | |
tags: allada/turbo-cache:test | |
target: builder | |
- name: Bazel test | |
run: docker run --rm -v $PWD:/root/turbo-cache allada/turbo-cache:test bazel test -c fastbuild //... | |
docker-compose-compiles-turbo-cache: | |
# 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/[email protected] | |
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: | | |
OPT_LEVEL=opt | |
OS_VERSION=${{ matrix.os_version }} | |
ADDITIONAL_SETUP_WORKER_CMD=DEBIAN_FRONTEND=noninteractive apt-get install -y gcc g++ lld pkg-config python3 | |
load: true # This brings the build into `docker images` from buildx. | |
tags: allada/turbo-cache:latest | |
- uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./deployment-examples/docker-compose/Dockerfile | |
build-args: | | |
OPT_LEVEL=opt | |
OS_VERSION=${{ matrix.os_version }} | |
load: true # This brings the build into `docker images` from buildx. | |
tags: allada/turbo-cache:builder | |
target: builder | |
- name: Compile turbo cache with turbo cache | |
run: | | |
mkdir -p ~/.cache && \ | |
cd deployment-examples/docker-compose && \ | |
docker-compose up -d && \ | |
cd ../../ && \ | |
docker run --rm --net=host -w /root/turbo-cache -v $PWD:/root/turbo-cache allada/turbo-cache:builder sh -c ' \ | |
bazel clean && \ | |
bazel test //... \ | |
--remote_instance_name=main \ | |
--remote_cache=grpc://127.0.0.1:50051 \ | |
--remote_executor=grpc://127.0.0.1:50052 \ | |
--remote_default_exec_properties=cpu_count=1 \ | |
' && \ | |
docker run --rm --net=host -w /root/turbo-cache -v $PWD:/root/turbo-cache allada/turbo-cache:builder sh -c ' \ | |
bazel clean && \ | |
bazel test //... \ | |
--remote_instance_name=main \ | |
--remote_cache=grpc://127.0.0.1:50051 \ | |
--remote_executor=grpc://127.0.0.1:50052 \ | |
--remote_default_exec_properties=cpu_count=1 \ | |
' 2>&1 | ( ! grep ' PASSED in ' ) # If we get PASSED without (cache) it means there's a cache issue. | |
integration-tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
# Which OS versions we will test on. | |
os_version: [ 20.04, 22.04 ] | |
steps: | |
- uses: actions/[email protected] | |
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: | | |
OPT_LEVEL=fastbuild | |
OS_VERSION=${{ matrix.os_version }} | |
load: true # This brings the build into `docker images` from buildx. | |
tags: allada/turbo-cache:latest | |
- 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/[email protected] | |
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 \ | |
//... |