Skip to content

Commit 048cf6d

Browse files
authored
Merge pull request #7 from fireblade-engine/ci
Add CI
2 parents 400d234 + a99c41f commit 048cf6d

File tree

10 files changed

+416
-29
lines changed

10 files changed

+416
-29
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: [ctreffs]
2+
custom: ['https://www.paypal.com/donate?hosted_button_id=GCG3K54SKRALQ']

.github/workflows/ci-linux.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Linux
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
linux-test-build-release:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
swift: ["latest"]
15+
container:
16+
image: swift:${{ matrix.swift }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@master
20+
21+
- name: Restore APT cache
22+
uses: actions/cache@v2
23+
with:
24+
path: /var/cache/apt
25+
key: ${{ runner.os }}-apt
26+
27+
- name: Restore cached SPM dependencies
28+
uses: actions/cache@v2
29+
with:
30+
path: |
31+
.build/repositories
32+
key: ${{ runner.os }}-spm-repos-${{ hashFiles('**/Package.resolved') }}
33+
restore-keys: |
34+
${{ runner.os }}-spm-repos-
35+
36+
- name: Install dependencies
37+
run: |
38+
apt update
39+
apt-get install -y libsdl2-dev
40+
sdl2-config --version
41+
42+
- name: Build Release
43+
run: swift build -c release

.github/workflows/ci-macos.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: macOS
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
macos-test-build-release-xcode:
11+
runs-on: macOS-11
12+
strategy:
13+
matrix:
14+
xcode: ["13.0"]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@master
18+
19+
- name: Select Xcode ${{ matrix.xcode }}
20+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
21+
22+
- name: Restore cached Homebrew dependencies
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
~/Library/Caches/Homebrew/sdl2--*
27+
~/Library/Caches/Homebrew/downloads/*--sdl2-*
28+
key: ${{ runner.os }}-brew-sdl2-${{ hashFiles('.github/brew-formulae') }}
29+
restore-keys: ${{ runner.os }}-brew-sdl2-
30+
31+
- name: Restore cached SPM dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: |
35+
.build/repositories
36+
key: ${{ runner.os }}-spm-repos-${{ hashFiles('**/Package.resolved') }}
37+
restore-keys: |
38+
${{ runner.os }}-spm-repos-
39+
40+
- name: Install dependencies
41+
run: |
42+
brew install sdl2
43+
sdl2-config --version
44+
45+
- name: Build Release
46+
run: swift build -c release
47+
env:
48+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
49+
50+
- name: Upload build artifacts
51+
if: failure()
52+
uses: actions/upload-artifact@v2.2.3
53+
with:
54+
name: build-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
55+
path: |
56+
*.lcov
57+
.build/*.yaml
58+
.build/**/*.a
59+
.build/**/*.so
60+
.build/**/*.dylib
61+
.build/**/*.dSYM
62+
.build/**/*.json
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Check markdown links
2+
3+
on: push
4+
5+
jobs:
6+
markdown-link-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@master
11+
- name: markdown-link-check
12+
uses: gaurav-nelson/github-action-markdown-link-check@master
13+

CODEOWNERS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file is a list of the people responsible for ensuring that contributions
2+
# to this projected are reviewed, either by themselves or by someone else.
3+
# They are also the gatekeepers for their part of this project, with the final
4+
# word on what goes in or not.
5+
# The code owners file uses a .gitignore-like syntax to specify which parts of
6+
# the codebase is associated with an owner. See
7+
# <https://docs.github.com/github/creating-cloning-and-archiving-repositories/about-code-owners>
8+
# for details.
9+
# The following lines are used by GitHub to automatically recommend reviewers.
10+
# Each line is a file pattern followed by one or more owners.
11+
12+
* @ctreffs
13+
Sources/Asteroid* @igorkravchenko

CODE_OF_CONDUCT.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement
63+
e.g. via [content abuse report][ref-report-abuse].
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][ref-homepage-cc],
118+
version 2.0, available at
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
<https://www.contributor-covenant.org/faq>.
126+
Translations are available at
127+
<https://www.contributor-covenant.org/translations>.
128+
129+
<!-- REFERENCES -->
130+
131+
[ref-homepage-cc]: https://www.contributor-covenant.org
132+
[ref-report-abuse]: https://docs.github.com/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam#reporting-an-issue-or-pull-request
133+
[ref-gh-coc]: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-code-of-conduct-to-your-project
134+
[ref-gh-abuse]: https://docs.github.com/en/communities/moderating-comments-and-conversations/managing-how-contributors-report-abuse-in-your-organizations-repository
135+
[ref-coc-guide]: https://opensource.guide/code-of-conduct/
136+

CONTRIBUTING.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# 💁 Contributing to this project
2+
3+
4+
> First off, thank you for considering contributing to this project.
5+
> It’s [people like you][ref-contributors] that keep this project alive and make it great!
6+
> Thank you! 🙏💜🎉👍
7+
8+
The following is a set of **guidelines for contributing** to this project.
9+
Use your best judgment and feel free to propose changes to this document in a pull request.
10+
11+
**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)
12+
13+
### 💡 Your contribution - the sky is the limit 🌈
14+
15+
This is an open source project and we love to receive contributions from our community — [**you**][ref-contributors]!
16+
17+
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
18+
[__writing code__][ref-pull-request-new] which can be incorporated into the repository itself.
19+
20+
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.
21+
22+
Note that we have a [code of conduct][ref-code-of-conduct], please follow it in all your interactions with the project.
23+
24+
### 🐞 You want to report a bug or file an issue?
25+
26+
1. Ensure that it was **not already reported** and is being worked on by checking [open issues][ref-issues].
27+
2. Create a [new issue][ref-issues-new] with a **clear and descriptive title**
28+
3. Write a **detailed comment** with as much relevant information as possible including
29+
- *how to reproduce* the bug
30+
- a *code sample* or an *executable test case* demonstrating the expected behavior that is not occurring
31+
- any *files that could help* trace it down (i.e. logs)
32+
33+
### 🩹 You wrote a patch that fixes an issue?
34+
35+
1. Open a [new pull request (PR)][ref-pull-request-new] with the patch.
36+
2. Ensure the PR description clearly describes the problem and solution.
37+
3. Link the relevant **issue** if applicable ([how to link issues in PRs][ref-pull-request-how-to]).
38+
4. Ensure that [**no tests are failing**][ref-gh-actions] and **coding conventions** are met
39+
5. Submit the patch and await review.
40+
41+
### 🎁 You want to suggest or contribute a new feature?
42+
43+
That's great, thank you! You rock 🤘
44+
45+
If you want to dive deep and help out with development on this project, then first get the project [installed locally][ref-readme].
46+
After that is done we suggest you have a look at tickets in our [issue tracker][ref-issues].
47+
You can start by looking through the beginner or help-wanted issues:
48+
- [__Good first issues__][ref-issues-first] are issues which should only require a few lines of code, and a test or two.
49+
- [__Help wanted issues__][ref-issues-help] are issues which should be a bit more involved than beginner issues.
50+
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.
51+
52+
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.
53+
These tickets have a general overview and description of the work required to finish.
54+
If you want to start somewhere, this would be a good place to start.
55+
That said, these aren't necessarily the easiest tickets.
56+
57+
For any new contributions please consider these guidelines:
58+
59+
1. Open a [new pull request (PR)][ref-pull-request-new] with a **clear and descriptive title**
60+
2. Write a **detailed comment** with as much relevant information as possible including:
61+
- What your feature is intended to do?
62+
- How it can be used?
63+
- What alternatives where considered, if any?
64+
- Has this feature impact on performance or stability of the project?
65+
66+
#### Your contribution responsibilities
67+
68+
Don't be intimidated by these responsibilities, they are easy to meet if you take your time to develop your feature 😌
69+
70+
- [x] Create issues for any major changes and enhancements that you wish to make. Discuss things transparently and get community feedback.
71+
- [x] Ensure (cross-)platform compatibility for every change that's accepted. An addition should not reduce the number of platforms that the project supports.
72+
- [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.
73+
- [x] Add tests for your feature that prove it's working as expected. Code coverage should not drop below its previous value.
74+
- [x] Ensure none of the existing tests are failing after adding your changes.
75+
- [x] Document your public API code and ensure to add code comments where necessary.
76+
77+
78+
### ⚙️ How to set up the environment
79+
80+
Please consult the [README][ref-readme] for installation instructions.
81+
82+
<!-- REFERENCES -->
83+
84+
[ref-code-of-conduct]: https://github.com/fireblade-engine/ecs-demo/blob/master/CODE_OF_CONDUCT.md
85+
[ref-contributors]: https://github.com/fireblade-engine/ecs-demo/graphs/contributors
86+
[ref-documentation]: https://github.com/fireblade-engine/ecs-demo/wiki
87+
[ref-gh-actions]: https://github.com/fireblade-engine/ecs-demo/actions
88+
[ref-issues-first]: https://github.com/fireblade-engine/ecs-demo/issues?q=is%3Aopen+is%3Aissue+label%3A"good+first+issue"
89+
[ref-issues-help]: https://github.com/fireblade-engine/ecs-demo/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted"
90+
[ref-issues-new]: https://github.com/fireblade-engine/ecs-demo/issues/new/choose
91+
[ref-issues]: https://github.com/fireblade-engine/ecs-demo/issues
92+
[ref-pull-request-how-to]: https://docs.github.com/en/github/writing-on-github/autolinked-references-and-urls
93+
[ref-pull-request-new]: https://github.com/fireblade-engine/ecs-demo/compare
94+
[ref-readme]: https://github.com/fireblade-engine/ecs-demo/blob/master/README.md
95+
[ref-makefile]: https://github.com/fireblade-engine/ecs-demo/blob/master/Makefile

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fireblade ECS Demo
22

33
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
4-
[![swift version](https://img.shields.io/badge/swift-5.3+-brightgreen.svg)](#)
5-
[![platforms](https://img.shields.io/badge/platform-macOS%20-brightgreen.svg)](#)
4+
[![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)
5+
[![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)
66

77
<p align="center">
88
<img height="315" src="./asteroids.gif"/> <img height="315" src="./particles.gif" />

0 commit comments

Comments
 (0)