Skip to content

Commit

Permalink
Add crystal 1.0.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
imdrasil committed Jun 28, 2021
1 parent c7ad8c1 commit 09e02f0
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 55 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
schedule:
- cron: "0 7 * * 1"

jobs:
test:
strategy:
fail-fast: false

runs-on: ubuntu-latest

steps:
- name: Install Crystal
uses: oprypin/install-crystal@v1

- name: Donwload sources
uses: actions/checkout@v2

- name: Check formatting
run: crystal tool format --check

- name: Install dependencies
run: shards install

- name: Run linter
run: ./bin/ameba

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0

- name: Run migrations
run: crystal sam.cr es:index:create_all

- name: Run specs
run: crystal spec
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

9 changes: 3 additions & 6 deletions sam.cr
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
require "./src/hermes"
require "./spec/config"
require "sam"

# Here you can define your tasks
# desc "with description to be used by help command"
# task "test" do
# puts "ping"
# end
require "./src/sam"

Sam.help
6 changes: 0 additions & 6 deletions script/runner.cr

This file was deleted.

8 changes: 4 additions & 4 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: hermes
version: 0.3.0
version: 0.3.1

authors:
- Roman Kalnytskyi <[email protected]>

crystal: 0.35.1
crystal: ">= 0.35.1"

license: MIT
development_dependencies:
sam:
github: imdrasil/sam.cr
version: "~> 0.3.0"
version: "~> 0.4.1"
ameba:
github: crystal-ameba/ameba
version: "= 0.12.1"
version: "= 0.14.3"
8 changes: 4 additions & 4 deletions spec/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class TestUserIndex < Hermes::Index
index_name "test_user_index"
config({
user: {
properties: {
full_name: {type: "text"},
location: {type: "geo_point"},
photo: {type: "binary"},
properties: {
full_name: {type: "text"},
location: {type: "geo_point"},
photo: {type: "binary"},
},
},
})
Expand Down
26 changes: 13 additions & 13 deletions spec/hermes/persistence_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ describe Hermes::Persistent do
post = build_post
hash = post.to_hash
hash.should eq({
"title" => post.title,
"likes" => post.likes,
"user" => post.user,
"text" => post.text,
"tag" => post.tag,
"created_at" => post.created_at,
"non_existing_field" => nil
"title" => post.title,
"likes" => post.likes,
"user" => post.user,
"text" => post.text,
"tag" => post.tag,
"created_at" => post.created_at,
"non_existing_field" => nil,
})
end
end
Expand All @@ -33,13 +33,13 @@ describe Hermes::Persistent do
post = build_post
hash = post.to_json
hash.should eq({
"title" => post.title,
"likes" => post.likes,
"user" => post.user,
"text" => post.text,
"tag" => post.tag,
"title" => post.title,
"likes" => post.likes,
"user" => post.user,
"text" => post.text,
"tag" => post.tag,
"created_at" => post.created_at,
}.to_json)
}.to_json)
end
end
end
2 changes: 1 addition & 1 deletion src/hermes.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require "./hermes/client"
require "./hermes/*"

module Hermes
VERSION = "0.3.0"
VERSION = "0.3.1"

def self.status
client.get("/")
Expand Down
1 change: 0 additions & 1 deletion src/hermes/search_response.cr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module Hermes
@[JSON::Field(key: "total")]
property total : Int32 | Hash(String, JSON::Any)


@[JSON::Field(key: "max_score")]
property max_score : Float32?

Expand Down

0 comments on commit 09e02f0

Please sign in to comment.