Skip to content

Commit

Permalink
feat: Add libmariadb E2E test in CircleCI.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommie committed Dec 28, 2024
1 parent 913595e commit 40f4e7d
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,38 @@ jobs:
paths:
- /home/circleci/cache

build-mysql-libmariadb-image:
docker:
- image: cimg/rust:1.78.0 # RUST_VER
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
resource_class: large
steps:
- setup_remote_docker:
docker_layer_caching: true
- checkout
- display-versions
- write-version
- run:
name: Build MySQL Docker image with libmariadb
command: docker build -t app:build --build-arg DATABASE_BACKEND=mysql --build-arg MYSQLCLIENTPKG=libmariadb-dev .
no_output_timeout: 30m
# save the built docker container into CircleCI's cache. This is
# required since Workflows do not have the same remote docker instance.
- run:
name: docker save app:build
command: |
mkdir -p /home/circleci/cache
docker save -o /home/circleci/cache/docker.tar "app:build"
- run:
name: Save docker-compose config
command: cp docker-compose*mysql.yaml /home/circleci/cache
- save_cache:
key: mysql-libmariadb-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
paths:
- /home/circleci/cache

build-spanner-image:
docker:
- image: cimg/rust:1.78.0 # RUST_VER
Expand Down Expand Up @@ -302,6 +334,44 @@ jobs:
command: cp /home/circleci/cache/docker-compose*.yaml .
- run-e2e-mysql-tests

mysql-e2e-tests:
docker:
- image: docker/compose:1.24.0
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
steps:
- setup_remote_docker
- display-versions
- restore_cache:
key: mysql-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Restore Docker image cache
command: docker load -i /home/circleci/cache/docker.tar
- run:
name: Restore docker-compose config
command: cp /home/circleci/cache/docker-compose*.yaml .
- run-e2e-mysql-tests

mysql-libmariadb-e2e-tests:
docker:
- image: docker/compose:1.24.0
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
steps:
- setup_remote_docker
- display-versions
- restore_cache:
key: mysql-libmariadb-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Restore Docker image cache
command: docker load -i /home/circleci/cache/docker.tar
- run:
name: Restore docker-compose config
command: cp /home/circleci/cache/docker-compose*.yaml .
- run-e2e-mysql-tests

spanner-e2e-tests:
docker:
- image: docker/compose:1.24.0
Expand Down Expand Up @@ -416,6 +486,12 @@ workflows:
filters:
tags:
only: /.*/
- build-mysql-libmariadb-image:
requires:
- build-and-test
filters:
tags:
only: /.*/
- build-spanner-image:
requires:
- build-and-test
Expand All @@ -428,6 +504,12 @@ workflows:
filters:
tags:
only: /.*/
- mysql-libmariadb-e2e-tests:
requires:
- build-mysql-libmariadb-image
filters:
tags:
only: /.*/
- spanner-e2e-tests:
requires:
- build-spanner-image
Expand All @@ -437,6 +519,7 @@ workflows:
- deploy:
requires:
- mysql-e2e-tests
- mysql-libmariadb-e2e-tests
- spanner-e2e-tests
filters:
tags:
Expand All @@ -447,6 +530,7 @@ workflows:
- deploy-python-utils:
requires:
- mysql-e2e-tests
- mysql-libmariadb-e2e-tests
- spanner-e2e-tests
filters:
tags:
Expand Down

0 comments on commit 40f4e7d

Please sign in to comment.