generated from athena-framework/component-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8df40bf
Showing
10 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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: Install Dependencies | ||
run: shards install | ||
- name: Build | ||
run: make docs | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: docs | ||
SINGLE_COMMIT: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# 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. | ||
|
||
1. Define a repo secret `ACCESS_TOKEN` for CI deploys to work. | ||
|
||
8.1 Alter [CI](./.github/workflows/ci.yml) and [Deployment](./.github/workflows/deployment.yml) scrips as needed. Such as adding custom `crystal docs` command or adding an `Install Dependencies` step. | ||
|
||
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 | ||
``` | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "./spec_helper" | ||
|
||
describe Athena::NAMESPACE_NAME do | ||
it "works" do | ||
false.should eq(true) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "spec" | ||
require "../src/athena-COMPONENT_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |