Skip to content

Commit

Permalink
create circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
sprsquish committed Nov 15, 2019
1 parent 7278373 commit 10edd31
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
version: 2.1
description: FaunaDB Swift Driver Tests

executors:
core:
resource_class: large
macos:
xcode: "11.0.0"
environment:
FAUNA_ROOT_KEY: secret
FAUNA_ENDPOINT: http://localhost:8443

commands:
build_and_test:
description: "Run siwft tests"
parameters:
version:
type: enum
enum: ["stable", "nightly"]
steps:
- checkout

- run:
name: Install Tools
command: brew install openjdk@11 awscli

- run:
name: Install FaunaDB
command: |
aws s3 cp s3://fauna-releases/<<parameters.version>>/latest-zip/faunadb.zip .
mkdir -p faunadb/{log,data}
cd faunadb
unzip -j ../faunadb.zip
- run:
name: Configure FaunaDB
command: |
echo "auth_root_key: secret" >> faunadb.yml
echo "cluster_name: fauna-macos" >> faunadb.yml
echo "network_broadcast_address: 127.0.0.1" >> faunadb.yml
echo "storage_data_path: $PWD/data" >> faunadb.yml
echo "log_path: $PWD/log" >> faunadb.yml
working_directory: faunadb

- run:
name: Start FaunaDB
command: ./faunadb
background: true
working_directory: faunadb

- run:
name: Wait for FaunaDB to start
command: "while ! netstat -tna | grep 'LISTEN' | grep '8444'; do sleep 0.1; done"

- run:
name: Initialize FaunaDB
command: ./faunadb-admin -r macos init
working_directory: faunadb

- run:
name: Wait for FaunaDB to init
command: "while ! $(curl --output /dev/null --silent --fail localhost:8443/ping); do sleep 0.1; done"

- run:
name: Setup tests
command: mkdir -p results/junit

- run:
name: Run Tests
command: xcodebuild -scheme FaunaDB -project ./FaunaDB.xcodeproj build test | xcpretty --report junit --output results/junit/results.xml

- store_test_results:
path: results/

jobs:
core-stable:
executor:
name: core
steps:
- build_and_test:
version: stable

core-nightly:
executor:
name: core
steps:
- build_and_test:
version: nightly

workflows:
version: 2
build_and_test:
jobs:
- core-stable:
context: faunadb-drivers
- core-nightly:
context: faunadb-drivers

0 comments on commit 10edd31

Please sign in to comment.