Skip to content

Commit

Permalink
Merge pull request #7 from fireblade-engine/ci
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
ctreffs authored Oct 12, 2021
2 parents 400d234 + a99c41f commit 048cf6d
Show file tree
Hide file tree
Showing 10 changed files with 416 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [ctreffs]
custom: ['https://www.paypal.com/donate?hosted_button_id=GCG3K54SKRALQ']
43 changes: 43 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Linux

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
linux-test-build-release:
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["latest"]
container:
image: swift:${{ matrix.swift }}
steps:
- name: Checkout
uses: actions/checkout@master

- name: Restore APT cache
uses: actions/cache@v2
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt

- name: Restore cached SPM dependencies
uses: actions/cache@v2
with:
path: |
.build/repositories
key: ${{ runner.os }}-spm-repos-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-repos-
- name: Install dependencies
run: |
apt update
apt-get install -y libsdl2-dev
sdl2-config --version
- name: Build Release
run: swift build -c release
62 changes: 62 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: macOS

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
macos-test-build-release-xcode:
runs-on: macOS-11
strategy:
matrix:
xcode: ["13.0"]
steps:
- name: Checkout
uses: actions/checkout@master

- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app

- name: Restore cached Homebrew dependencies
uses: actions/cache@v2
with:
path: |
~/Library/Caches/Homebrew/sdl2--*
~/Library/Caches/Homebrew/downloads/*--sdl2-*
key: ${{ runner.os }}-brew-sdl2-${{ hashFiles('.github/brew-formulae') }}
restore-keys: ${{ runner.os }}-brew-sdl2-

- name: Restore cached SPM dependencies
uses: actions/cache@v2
with:
path: |
.build/repositories
key: ${{ runner.os }}-spm-repos-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-repos-
- name: Install dependencies
run: |
brew install sdl2
sdl2-config --version
- name: Build Release
run: swift build -c release
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

- name: Upload build artifacts
if: failure()
uses: actions/[email protected]
with:
name: build-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
path: |
*.lcov
.build/*.yaml
.build/**/*.a
.build/**/*.so
.build/**/*.dylib
.build/**/*.dSYM
.build/**/*.json
13 changes: 13 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Check markdown links

on: push

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: markdown-link-check
uses: gaurav-nelson/github-action-markdown-link-check@master

13 changes: 13 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file is a list of the people responsible for ensuring that contributions
# to this projected are reviewed, either by themselves or by someone else.
# They are also the gatekeepers for their part of this project, with the final
# word on what goes in or not.
# The code owners file uses a .gitignore-like syntax to specify which parts of
# the codebase is associated with an owner. See
# <https://docs.github.com/github/creating-cloning-and-archiving-repositories/about-code-owners>
# for details.
# The following lines are used by GitHub to automatically recommend reviewers.
# Each line is a file pattern followed by one or more owners.

* @ctreffs
Sources/Asteroid* @igorkravchenko
136 changes: 136 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement
e.g. via [content abuse report][ref-report-abuse].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][ref-homepage-cc],
version 2.0, available at
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
<https://www.contributor-covenant.org/faq>.
Translations are available at
<https://www.contributor-covenant.org/translations>.

<!-- REFERENCES -->

[ref-homepage-cc]: https://www.contributor-covenant.org
[ref-report-abuse]: https://docs.github.com/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam#reporting-an-issue-or-pull-request
[ref-gh-coc]: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-code-of-conduct-to-your-project
[ref-gh-abuse]: https://docs.github.com/en/communities/moderating-comments-and-conversations/managing-how-contributors-report-abuse-in-your-organizations-repository
[ref-coc-guide]: https://opensource.guide/code-of-conduct/

95 changes: 95 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# 💁 Contributing to this project


> First off, thank you for considering contributing to this project.
> It’s [people like you][ref-contributors] that keep this project alive and make it great!
> Thank you! 🙏💜🎉👍
The following is a set of **guidelines for contributing** to this project.
Use your best judgment and feel free to propose changes to this document in a pull request.

**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)

### 💡 Your contribution - the sky is the limit 🌈

This is an open source project and we love to receive contributions from our community — [**you**][ref-contributors]!

There are many ways to contribute, from writing __tutorials__ or __blog posts__, improving the [__documentation__][ref-documentation], submitting [__bug reports__][ref-issues-new] and [__enhancement__][ref-pull-request-new] or
[__writing code__][ref-pull-request-new] which can be incorporated into the repository itself.

When contributing to this project, please feel free to discuss the changes and ideas you wish to contribute with the repository owners before making a change by opening a [new issue][ref-issues-new] and add the **feature request** tag to that issue.

Note that we have a [code of conduct][ref-code-of-conduct], please follow it in all your interactions with the project.

### 🐞 You want to report a bug or file an issue?

1. Ensure that it was **not already reported** and is being worked on by checking [open issues][ref-issues].
2. Create a [new issue][ref-issues-new] with a **clear and descriptive title**
3. Write a **detailed comment** with as much relevant information as possible including
- *how to reproduce* the bug
- a *code sample* or an *executable test case* demonstrating the expected behavior that is not occurring
- any *files that could help* trace it down (i.e. logs)

### 🩹 You wrote a patch that fixes an issue?

1. Open a [new pull request (PR)][ref-pull-request-new] with the patch.
2. Ensure the PR description clearly describes the problem and solution.
3. Link the relevant **issue** if applicable ([how to link issues in PRs][ref-pull-request-how-to]).
4. Ensure that [**no tests are failing**][ref-gh-actions] and **coding conventions** are met
5. Submit the patch and await review.

### 🎁 You want to suggest or contribute a new feature?

That's great, thank you! You rock 🤘

If you want to dive deep and help out with development on this project, then first get the project [installed locally][ref-readme].
After that is done we suggest you have a look at tickets in our [issue tracker][ref-issues].
You can start by looking through the beginner or help-wanted issues:
- [__Good first issues__][ref-issues-first] are issues which should only require a few lines of code, and a test or two.
- [__Help wanted issues__][ref-issues-help] are issues which should be a bit more involved than beginner issues.
These are meant to be a great way to get a smooth start and won't put you in front of the most complex parts of the system.

If you are up to more challenging tasks with a bigger scope, then there are a set of tickets with a __feature__, __enhancement__ or __improvement__ tag.
These tickets have a general overview and description of the work required to finish.
If you want to start somewhere, this would be a good place to start.
That said, these aren't necessarily the easiest tickets.

For any new contributions please consider these guidelines:

1. Open a [new pull request (PR)][ref-pull-request-new] with a **clear and descriptive title**
2. Write a **detailed comment** with as much relevant information as possible including:
- What your feature is intended to do?
- How it can be used?
- What alternatives where considered, if any?
- Has this feature impact on performance or stability of the project?

#### Your contribution responsibilities

Don't be intimidated by these responsibilities, they are easy to meet if you take your time to develop your feature 😌

- [x] Create issues for any major changes and enhancements that you wish to make. Discuss things transparently and get community feedback.
- [x] Ensure (cross-)platform compatibility for every change that's accepted. An addition should not reduce the number of platforms that the project supports.
- [x] Ensure **coding conventions** are met. Lint your code with the project's default tools. Project wide commands are available through the [Makefile][ref-makefile] in the repository root.
- [x] Add tests for your feature that prove it's working as expected. Code coverage should not drop below its previous value.
- [x] Ensure none of the existing tests are failing after adding your changes.
- [x] Document your public API code and ensure to add code comments where necessary.


### ⚙️ How to set up the environment

Please consult the [README][ref-readme] for installation instructions.

<!-- REFERENCES -->

[ref-code-of-conduct]: https://github.com/fireblade-engine/ecs-demo/blob/master/CODE_OF_CONDUCT.md
[ref-contributors]: https://github.com/fireblade-engine/ecs-demo/graphs/contributors
[ref-documentation]: https://github.com/fireblade-engine/ecs-demo/wiki
[ref-gh-actions]: https://github.com/fireblade-engine/ecs-demo/actions
[ref-issues-first]: https://github.com/fireblade-engine/ecs-demo/issues?q=is%3Aopen+is%3Aissue+label%3A"good+first+issue"
[ref-issues-help]: https://github.com/fireblade-engine/ecs-demo/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted"
[ref-issues-new]: https://github.com/fireblade-engine/ecs-demo/issues/new/choose
[ref-issues]: https://github.com/fireblade-engine/ecs-demo/issues
[ref-pull-request-how-to]: https://docs.github.com/en/github/writing-on-github/autolinked-references-and-urls
[ref-pull-request-new]: https://github.com/fireblade-engine/ecs-demo/compare
[ref-readme]: https://github.com/fireblade-engine/ecs-demo/blob/master/README.md
[ref-makefile]: https://github.com/fireblade-engine/ecs-demo/blob/master/Makefile
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Fireblade ECS Demo

[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![swift version](https://img.shields.io/badge/swift-5.3+-brightgreen.svg)](#)
[![platforms](https://img.shields.io/badge/platform-macOS%20-brightgreen.svg)](#)
[![macOS](https://github.com/fireblade-engine/ecs-demo/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/fireblade-engine/ecs-demo/actions/workflows/ci-macos.yml)
[![Linux](https://github.com/fireblade-engine/ecs-demo/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/fireblade-engine/ecs-demo/actions/workflows/ci-linux.yml)

<p align="center">
<img height="315" src="./asteroids.gif"/> <img height="315" src="./particles.gif" />
Expand Down
Loading

0 comments on commit 048cf6d

Please sign in to comment.