Initial commit

This commit is contained in:
George Dietrich 2020-12-21 23:21:53 -05:00
commit 34c8539ead
10 changed files with 204 additions and 0 deletions

9
.editorconfig Normal file
View file

@ -0,0 +1,9 @@
root = true
[*.cr]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

44
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: CI
on:
pull_request:
branches:
- 'master'
schedule:
- cron: '0 21 * * *'
jobs:
check_format:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:latest-alpine
steps:
- uses: actions/checkout@v2
- name: Format
run: crystal tool format --check
coding_standards:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:latest-alpine
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: shards install
- name: Ameba
run: ./bin/ameba
test_latest:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:latest-alpine
steps:
- uses: actions/checkout@v2
- name: Specs
run: crystal spec --order random --error-on-warnings
test_nightly:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:nightly-alpine
steps:
- uses: actions/checkout@v2
- name: Specs
run: crystal spec --order random --error-on-warnings

25
.github/workflows/deployment.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Deployment
on:
push:
branches:
- master
jobs:
deploy_docs:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:latest-alpine
steps:
- name: Install Build Dependencies
run: apk add --update rsync
- uses: actions/checkout@v2
- name: Build
run: crystal docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs
SINGLE_COMMIT: true

9
.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
/docs/
/lib/
/bin/
/.shards/
*.dwarf
# Libraries don't need dependency lock
# Dependencies will be locked in applications that use them
/shard.lock

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 CREATOR_NAME
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

59
README.md Normal file
View file

@ -0,0 +1,59 @@
# README
Template repo for creating a new Athena component. Scaffolds the Crystal shard's structure as well as define CI etc.
**NOTE:** This repo assumes the component will be in the `athena-framework` org. If it is to be used outside of the org, be sure to update URLs accordingly.
1. Find/replace `COMPONENT_NAME` with the name of the component. This is used as the shard's name. E.x. `logger`.
1.1 Be sure to rename the file in `./src`, and `./spec` as well.
1. Replace `NAMESPACE_NAME` with the name of the component's namespace. Documentation for this component will be grouped under this. E.x. `Logger`.
1. Find/replace `CREATOR_NAME` with your Github display name. E.x. `George Dietrich`.
1. Find/replace `CREATOR_USERNAME` with your Github username. E.x. `blacksmoke16`.
1. Find/replace `CREATOR_EMAIL` with your desired email
5.1 Can remove this if you don't wish to expose an email.
1. Find/replace `ALIAS_NAME` with the three letter alias for this component; A + 2 letter shortcut to `NAMESPACE_NAME`. E.x. `ALG`.
1. Find/replace `DESCRIPTION` with a short description of what the component does.
Delete from here up
# NAMESPACE_NAME
[![CI](https://github.com/athena-framework/COMPONENT_NAME/workflows/CI/badge.svg)](https://github.com/athena-framework/COMPONENT_NAME/actions?query=workflow%3ACI)
[![Latest release](https://img.shields.io/github/release/athena-framework/COMPONENT_NAME.svg)](https://github.com/athena-framework/COMPONENT_NAME/releases)
DESCRIPTION
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
athena-COMPONENT_NAME:
github: athena-framework/COMPONENT_NAME
version: ~> 1.0.0
```
2. Run `shards install`
## Documentation
Everything is documented in the [API Docs](https://athena-framework.github.io/COMPONENT_NAME/Athena/NAMESPACE_NAME.html).
## Contributing
1. Fork it (https://github.com/athena-framework/COMPONENT_NAME/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [CREATOR_NAME](https://github.com/CREATOR_USERNAME) - creator and maintainer

22
shard.yml Normal file
View file

@ -0,0 +1,22 @@
name: athena-COMPONENT_NAME
version: 0.1.0
crystal: '>= 0.35.0'
license: MIT
repository: https://github.com/athena-framework/COMPONENT_NAME
documentation: https://athena-framework.github.io/COMPONENT_NAME/Athena/NAMESPACE_NAME.html
description: |
DESCRIPTION.
authors:
- CREATOR_NAME <CREATOR_EMAIL>
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 0.13.0

View file

@ -0,0 +1,7 @@
require "./spec_helper"
describe Athena::NAMESPACE_NAME do
it "works" do
false.should eq(true)
end
end

2
spec/spec_helper.cr Normal file
View file

@ -0,0 +1,2 @@
require "spec"
require "../src/athena-COMPONENT_NAME"

View file

@ -0,0 +1,6 @@
# Convenience alias to make referencing `Athena::NAMESPACE_NAME` types easier.
alias ALIAS_NAME = Athena::NAMESPACE_NAME
module Athena::NAMESPACE_NAME
VERSION = "0.1.0"
end