Skip to content

Commit

Permalink
chore: setup github stuff
Browse files Browse the repository at this point in the history
- [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

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

This file was deleted.

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.2'
benchmark: false
- ruby-version: '2.3'
benchmark: true
- ruby-version: '2.4'
benchmark: true
- ruby-version: '2.5'
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![CircleCI](https://circleci.com/gh/procore/blueprinter.svg?style=svg)](https://circleci.com/gh/procore/blueprinter)
![Tests](https://github.com/procore/blueprinter/actions/workflows/test.yml/badge.svg?branch=master)
[![Gem Version](https://badge.fury.io/rb/blueprinter.svg)](https://badge.fury.io/rb/blueprinter)
[![Gitter chat](https://badges.gitter.im/procore/blueprinter.svg)](https://gitter.im/blueprinter-gem/community)

Expand Down

0 comments on commit 8aa3605

Please sign in to comment.