Skip to content

Commit

Permalink
Run examples_test.bats on travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jun 29, 2018
1 parent 6b39957 commit 5b1a3c3
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ env:
GIT_COMMITTER_NAME: travis-ci
GIT_COMMITTER_EMAIL: [email protected]

addons:
apt:
sources:
- sourceline: 'ppa:duggan/bats'
packages:
- bats

script:
- crystal spec
- crystal tool format --check src spec
- bats examples_test.bats
- "if [ $TRAVIS_TEST_RESULT -eq 0 ]; then scripts/generate-docs.sh && curl https://raw.githubusercontent.com/straight-shoota/autodeploy-docs/master/autodeploy-docs.sh | bash; fi"
50 changes: 50 additions & 0 deletions examples_test.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bats

@test "examples/config" {
pushd "examples/config"
shards install

crystal run config.cr
crystal run config.cr --release --no-debug
popd
}

@test "examples/kemal" {
pushd "examples/kemal"
shards install

crystal build kemal.cr
crystal build kemal.cr --release --no-debug

popd
}

@test "examples/kilt" {
pushd "examples/kilt"
shards install

crystal run kilt.cr
crystal run kilt.cr --release --no-debug

popd
}

@test "examples/rwbench" {
pushd "examples/rwbench"
shards install

crystal run rwbench.cr
crystal run rwbench.cr --release --no-debug

popd
}

@test "examples/server" {
pushd "examples/server"
shards install

crystal build server.cr
crystal build server.cr --release --no-debug

popd
}
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: crinja
version: 0.3.0
license: Apache-2.0
crystal: 0.24.1
crystal: 0.25.1

authors:
- Johannes Müller <[email protected]>
Expand Down

0 comments on commit 5b1a3c3

Please sign in to comment.