Skip to content

Commit

Permalink
chore: setup github stuff
Browse files Browse the repository at this point in the history
- [x] switch to 2.7+ ruby versions in tests
- [x] github actions for tests and release instead of circleci
  - [ ] add secrets to repository
- [x] dependabot
- [x] stale github action
- [x] auto assign author github action
- [x] update README tests badge
- [x] add CONTRIBUTING.md, CODE_OF_CONDUCT.md, and .github/PULL_REQUEST_TEMPLATE.md

Signed-off-by: jmeridth <[email protected]>
  • Loading branch information
jmeridth committed Jun 22, 2023
1 parent fd274a3 commit 0aa6f82
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 90 deletions.
89 changes: 0 additions & 89 deletions .circleci/config.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
Note on DCO:
If the DCO check fails, one or more of your commits are not signed off. Please click on the *Details* link next to the DCO action for instructions on how to resolve this.
-->

Checklist:

* [ ] I have bumped any necessary versions according to this project
* [ ] I have updated the necessary documentation
* [ ] I have updated the changelog, if necessary
* [ ] I have signed off all my commits as required by [DCO](../CONTRIBUTING.md#legal)
* [ ] My build is green
11 changes: 11 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: /
schedule:
interval: "weekly"
timezone: "America/Los_Angeles"
labels:
- "dependabot"
- "docker"
- "dependencies"
13 changes: 13 additions & 0 deletions .github/workflows/auto-assign-author.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Auto Author Assign'

on:
pull_request_target:
types: [opened, reopened]

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@0fd2847dd52b3cb103d743049dcfb7f17d39c51f # (latest, untagged)
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [master, main]
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # (latest, untagged)
- name: Installing ruby dependencies
run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
- name: Sign in to Github as Bot
run: |
git config --global user.email "$GIT_BOT_EMAIL"
git config --global user.name "$GIT_BOT_NAME"
- name: Auth RubyGems
run: |
mkdir ~/.gem
install -m 0600 /dev/null ~/.gem/credentials
echo -e "---\n:rubygems_api_key: $RUBY_GEMS_API_KEY" > ~/.gem/credentials
- name: Release New Gem Version
run: |
GEM_VERSION=$(ruby -r "./lib/blueprinter/version.rb" -e "puts Blueprinter::VERSION")
echo "Attempting to release version '$GEM_VERSION' of Blueprinter..."
bundle exec rake release || true # Don't fail when deploy does not take place
39 changes: 39 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Close stale issues and PR'
on:
workflow_dispatch:
schedule:
- cron: '30 1 * * *' # https://crontab.guru/#30_1_*_*_* (everyday at 0130)

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@02989dcb65055c8fd08a5dec9332c1279c8e2639 # (latest, untagged)
with:
operations-per-run: 200
ascending: true
delete-branch: true
stale-issue-message: >
This issue is stale because it has been open 10 days with no activity.
Replace the `no-issue-activity` label with a `work-in-progress` label or comment or
this will be closed in 5 days.
close-issue-message: >
This issue was closed because it has been stalled for 5 days with no activity.
days-before-issue-stale: 10
days-before-issue-close: 5
stale-issue-label: 'no-issue-activity'
exempt-issue-labels: 'awaiting-approval,work-in-progress'
stale-pr-message: >
This PR is stale because it has been open 20 days with no activity.
Replace the `no-pr-activity` label with a `work-in-progress` label or comment or
this will be closed in 5 days.
close-pr-message: >
This PR was closed because it has been stalled for 5 days with no activity.
days-before-pr-stale: 20
days-before-pr-close: 5
stale-pr-label: 'no-pr-activity'
exempt-pr-labels: 'awaiting-approval,work-in-progress,dependencies'
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ruby-version: '2.7'
benchmark: true
- ruby-version: '3.0'
benchmark: true
- ruby-version: '3.1'
benchmark: true
- ruby-version: '3.2'
benchmark: true
steps:
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # (latest, untagged)
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
130 changes: 130 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# 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
* Spam or other deceptive practices that take advantage of the community
* 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 at
<[email protected]>.
All complaints will be reviewed and investigated promptly and fairly by
the [Procore Open Source Program Office (OSPO)](docs/contact.md)

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][homepage],
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).

[homepage]: https://www.contributor-covenant.org

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>.
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contributing to Procore Projects

This document explains the common procedures expected by contributors while submitting code to Procore open source projects.

## Code of Conduct

Please read and abide by the [Code of Conduct](CODE_OF_CONDUCT.md)

## General workflow

Once a GitHub issue is accepted and assigned to you, please follow general workflow in order to submit your contribution:

1. Fork the target repository under your GitHub username.
2. Create a branch in your forked repository for the changes you are about to make.
3. Commit your changes in the branch you created in step 2. All commits need to be signed-off. Check the [legal](#legal) section bellow for more details.
4. Push your commits to your remote fork.
5. Create a Pull Request from your remote fork pointing to the HEAD branch (usually `main` branch) of the target repository.
6. Check the GitHub build and ensure that all checks are green.

## Legal

Procore projects use Developer Certificate of Origin ([DCO](https://GitHub.com/apps/dco/)).

Please sign-off your contributions by doing ONE of the following:

* Use `git commit -s ...` with each commit to add the sign-off or
* Manually add a `Signed-off-by: Your Name <[email protected]>` to each commit message.

The email address must match your primary GitHub email. You do NOT need cryptographic (e.g. gpg) signing.

* Use `git commit -s --amend ...` to add a sign-off to the latest commit, if you forgot.

*Note*: Some projects will provide specific configuration to ensure all commits are signed-off. Please check the project's documentation for more details.

## Tests

Make sure your changes are properly covered by automated tests. We aim to build an efficient test suite that is low cost to maintain and bring value to project. Prefer writing unit-tests over heavy end-to-end (e2e) tests. However, sometimes e2e tests are necessary. If you aren't sure, ask one of the maintainers about the requirements for your pull-request.
Loading

0 comments on commit 0aa6f82

Please sign in to comment.