Skip to content

Commit

Permalink
Merge pull request #47 from apsislabs/breaking/v0.4.0
Browse files Browse the repository at this point in the history
Breaking/v0.4.0
  • Loading branch information
wkirby authored Jan 31, 2023
2 parents 3e862c4 + e7bf5f5 commit d3ee182
Show file tree
Hide file tree
Showing 63 changed files with 1,447 additions and 1,171 deletions.
9 changes: 8 additions & 1 deletion .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/env bash

if [[ $DOCKER_CONTAINER -ne 1 ]]; then
if [[ $(docker-compose ps -q | wc -l) -gt 0 ]]; then
source bin/helpers/docker
runOnDocker ruby
fi
fi

echo "Starting unit tests"
bundle exec rake test
bundle exec rake spec
if [ $? -ne 0 ]; then
echo ""
echo ""
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .github/workflows/release.yml

name: Release

on:
workflow_dispatch:
pull_request:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
- run: bundle install
- name: publish gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"

28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test & Lint

on:
push:
branches: [master]
pull_request:

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: ['3.1', '3.0', '2.7']

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: Rubocop
run: rubocop
- name: Run tests
run: bundle exec rake
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
*.gem
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/vendor/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
*.gem
/Gemfile.lock
/log*/*
.byebug_history
.byebug_history

# rspec failure tracking
.rspec_status

.DS_Store
2 changes: 0 additions & 2 deletions .hound.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
41 changes: 22 additions & 19 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.1
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.1
Include:
- 'lib/**/*.rb'
- 'test/**/*.rb'
- 'spec/**/*.rb'
- '**/Gemfile'
- '**/Rakefile'
Exclude:
- 'bin/**/*'
- 'test/fixtures/**/*.rb'

Style/HashSyntax:
EnforcedShorthandSyntax: never

Style/Documentation:
Enabled: false

Naming/BlockForwarding:
Enabled: false

Style/RedundantSelf:
Enabled: false
Expand All @@ -21,36 +33,27 @@ Style/GuardClause:
Style/ClassAndModuleChildren:
Enabled: false

Style/EmptyLinesAroundClassBody:
Layout/EmptyLinesAroundClassBody:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/CommentIndentation:
Enabled: false

Style/BracesAroundHashParameters:
Layout/CommentIndentation:
Enabled: false

Style/IndentationConsistency:
EnforcedStyle: rails

Metrics/LineLength:
Layout/LineLength:
Max: 120

Metrics/ClassLength:
Max: 120

Style/EmptyLineBetweenDefs:
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true

# Temporarily disabled until this can be resolved in the todo file
# Style/Documentation:
# Exclude:
# - 'spec/**/*'
# - 'test/**/*'
# - 'lib/ext/**/*'
Naming/MethodParameterName:
AllowedNames:
- _

Style/ClassVars:
Exclude:
Expand Down
48 changes: 0 additions & 48 deletions .rubocop_todo.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:3.1.2-alpine

RUN apk add --no-cache --update \
bash \
alpine-sdk \
sqlite-dev

ENV APP_HOME /app
WORKDIR $APP_HOME

COPY . $APP_HOME/

EXPOSE 3000

CMD ["bash"]
Loading

0 comments on commit d3ee182

Please sign in to comment.