Skip to content

Commit

Permalink
ci: bootstrapping .github folder
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jan 25, 2024
1 parent acf261e commit 413e621
Show file tree
Hide file tree
Showing 8 changed files with 301 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Contributing to REEV

We love your input!
We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## We Develop with GiHhub

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow), So All Code Changes Happen Through Pull Requests

Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flowl)).
We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Use [conventional ommits](https://www.conventionalcommits.org/en/v1.0.0/) for your commit messages.
7. Issue that pull request!

## Any contributions you make will be under the MIT Software License

In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project.
Feel free to contact the maintainers if that's a concern.

## Report bugs using GitHub's [issues](https://github.com/bihealth/reev-frontend/issues)

We use GitHub issues to track public bugs.
Report a bug by [opening a new issue](https://github.com/bihealth/reev-frontend/issues/new/choose); it's that easy!

## Write bug reports with detail, background, and sample code

[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug report that we found, and we think it's not a bad model.
Here's [another example from Craig Hockenberry](http://www.openradar.me/11905408), an app developer whom we respect.

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can. [Above stackoverflow question](http://stackoverflow.com/q/12488905/180626) includes sample code that *anyone* with a base R setup can run to reproduce what the reporter was seeing
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

People *love* thorough bug reports.
We're not even kidding.

## Use a Consistent Coding Style

We use black for Python code and prettier for JavaScript code.
You can find plenty examples in the code base and our continuous integration will enforce the style guides.
You can use the `make lint` target to check your code style locally.

## License

By contributing, you agree that your contributions will be licensed under its MIT License.

## References

This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

<!--
For general questions please use the Discussions section of the project:
https://github.com/bihealth/reev/discussions
For bug reports and feature requests please open a ticket using the templates!
-->

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

<!--
For general questions please use the Discussions section of the project:
https://github.com/bihealth/reev/discussions
For bug reports and feature requests please open a ticket using the templates!
-->

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
NOTE
NOTE In most cases, you should create an issue first, and only then
NOTE a pull request. Please see the contribution guidelines for
NOTE further information. In particular related to conventional
NOTE commit messages.
NOTE
The title should have the following format:
<type>: description (#<issue>)
-->
19 changes: 19 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Dependabot auto-merge

on: pull_request

permissions:
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
# GitHub provides this variable in the CI env. You don't
# need to add anything to the secrets vault.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/conventional-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
title-format:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
74 changes: 74 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
Cancel-Previous:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: khan/[email protected]
with:
workflows: "python.yml"
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Set up node 20.x
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
cache-dependency-path: |
package-lock.json
- name: Install deps
run: make deps

- name: Lint source code
run: make lint

Test:
runs-on: ubuntu-latest
needs:
- Lint
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: 'true'

- name: Set up node 20.x
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
cache-dependency-path: |
package-lock.json
- name: Install dependencies
run: make deps

- name: Run tests
run: make test-ci

- name: Upload frontend coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
flags: frontend
directory: frontend
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_name: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
steps:
- name: Create GitHub release
id: release
uses: GoogleCloudPlatform/release-please-action@v4
with:
token: ${{ secrets.BOT_TOKEN }}

Package-Release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

# TODO: create package and upload to GitHub

0 comments on commit 413e621

Please sign in to comment.