Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Blacksmoke16 committed Oct 30, 2020
0 parents commit 8df40bf
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
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
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
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
27 changes: 27 additions & 0 deletions .github/workflows/deployment.yml
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
9 changes: 9 additions & 0 deletions .gitignore
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
21 changes: 21 additions & 0 deletions LICENSE
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.
62 changes: 62 additions & 0 deletions README.md
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
22 changes: 22 additions & 0 deletions shard.yml
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
7 changes: 7 additions & 0 deletions spec/athena-COMPONENT_TEMPLATE_spec.cr
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
2 changes: 2 additions & 0 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require "spec"
require "../src/athena-COMPONENT_NAME"
6 changes: 6 additions & 0 deletions src/athena-COMPONENT_NAME.cr
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

0 comments on commit 8df40bf

Please sign in to comment.