You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mongo-rust-driver/.semaphore/semaphore.yml

45 lines
1.3 KiB
YAML

version: v1.0
name: Mongo Rust Driver tests
agent:
machine:
type: e1-standard-8
os_image: ubuntu1804
# Cancel all running and queued workflows before this one
auto_cancel:
running:
# Ignore main AND develop branch as we want it to build all workflows
when: "branch != 'main' AND branch != 'develop'"
global_job_config:
env_vars:
- name: "CONTAINER_NAME"
value: rust
- name: "COMPOSE_OPTIONS"
value: "-f .semaphore/docker-compose.yml"
prologue:
commands:
- checkout
blocks:
- name: Build & Test
dependencies: []
task:
prologue:
commands:
# Create containers but don't start them yet. We first want to copy the caches onto it
- docker-compose $COMPOSE_OPTIONS up --no-start
# Copy project to main test container
- docker cp . $CONTAINER_NAME:/project
# Then start the containers so we can run the test on it
- docker-compose $COMPOSE_OPTIONS up -d --no-recreate
# Install dependencies
- docker-compose $COMPOSE_OPTIONS exec $CONTAINER_NAME apt-get update
- docker-compose $COMPOSE_OPTIONS exec $CONTAINER_NAME apt-get install -y cmake libssl-dev libsasl2-dev libicu-dev
jobs:
- name: Test
commands:
- docker-compose $COMPOSE_OPTIONS exec $CONTAINER_NAME cargo test