Skip to content

Commit 5cd0930

Browse files
committed
Use nix for CI, tapioca for RBIs, update version
1 parent 55fe300 commit 5cd0930

File tree

117 files changed

+40218
-34180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+40218
-34180
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Continuous Integration
3+
on:
4+
push:
5+
branches-ignore:
6+
- refs/tags/*_staging
7+
- refs/tags/*_production
8+
jobs:
9+
build:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- name: Checkout branch
13+
uses: actions/checkout@v2
14+
- name: Extract branch name
15+
shell: bash
16+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
17+
id: extract_branch
18+
- name: Cache gems
19+
uses: actions/cache@v2
20+
with:
21+
path: vendor/bundle
22+
key: "${{ runner.OS }}-gem-cache-${{ hashFiles('**/*.gemspec')
23+
}}"
24+
restore-keys: "${{ runner.OS }}-gem-cache-\n"
25+
- uses: "cachix/install-nix-action@8d6d5e949675fbadb765c6b1a975047fa5f09b27"
26+
with:
27+
extra_nix_config: |
28+
post-build-hook = /etc/nix/upload-to-cache.sh
29+
substituters = https://cache.nixos.org/
30+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
31+
nix_path: nixpkgs=channel:nixos-21.05
32+
- name: Run CI through nix-shell
33+
env:
34+
GEMFURY_DEPLOY_TOKEN: ${{ secrets.GEMFURY_DEPLOY_TOKEN }}
35+
run: nix-shell --run "chmod 755 ./run_ci.sh && ./run_ci.sh"
36+
- name: Post to Slack if build fails
37+
if: failure() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
38+
|| github.ref == 'refs/heads/stable')
39+
uses: pullreminders/slack-action@a5a262c896a1cc80dcbae59ba95513e2dfb21439
40+
env:
41+
SLACK_BOT_TOKEN: "${{ secrets.SLACK_BOT_TOKEN }}"
42+
with:
43+
args: '{\"channel\":\"C33574SJJ\",\"text\":\"* ${{ github.repository }} BUILD
44+
FAILURE*\", \"attachments\": [{ \"fallback\": \"Failure summary\", \"color\":
45+
\"#ff0000\", \"fields\": [{\"title\": \"Branch\", \"value\":\"${{ steps.extract_branch.outputs.branch
46+
}}\"}, {\"title\": \"Who broke it\", \"value\":\"${{ github.actor }}\"},
47+
{ \"title\": \"Build output\", \"value\": \"https://github.com/${{ github.repository
48+
}}/commit/${{ github.sha }}/checks\", \"short\": false }]}]}'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
.DS_Store
2121

2222
.ruby-gemset
23+
.direnv
24+
.envrc

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.2.1
2+
3+
* Add some nicer error messages when dependencies are not found
4+
* Use Tapioca for RBI generation
5+
* Use Nix for development environment and CI (Bellroy standard)
6+
17
1.2.0
28

39
* Deprecated references are now drawn on the output graph.

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ group :development, :test do
1010
gem 'rb-fsevent', require: false
1111
gem 'rb-readline'
1212
gem 'rspec'
13-
gem 'shoulda-matchers', require: false
1413
end

bin/tapioca

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'tapioca' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("tapioca", "tapioca")

graphwerk.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
3333
spec.add_development_dependency 'rspec', '~> 3.0'
3434
spec.add_development_dependency 'sorbet'
3535
spec.add_development_dependency 'rspec-sorbet'
36+
spec.add_development_dependency 'tapioca'
3637
end

lib/graphwerk/railtie.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# typed: false
1+
# typed: ignore
22
# frozen_string_literal: true
33

44
module Graphwerk

lib/graphwerk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# frozen_string_literal: true
33

44
module Graphwerk
5-
VERSION = '1.2.0'
5+
VERSION = '1.2.1'
66
end

nix/sources.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"nixpkgs": {
3+
"branch": "nixos-21.05",
4+
"description": "Nix packages collection",
5+
"homepage": "https://github.com/NixOS/nixpkgs",
6+
"owner": "NixOS",
7+
"repo": "nixpkgs",
8+
"rev": "e85f0175e3effe9ba191d66c09e8f1b7d6362d5e",
9+
"sha256": "1qr2hmymbzwj8jrz6smcgc04scgwp2v5070x22k4fvh261g1n4zw",
10+
"type": "tarball",
11+
"url": "https://github.com/NixOS/nixpkgs/archive/e85f0175e3effe9ba191d66c09e8f1b7d6362d5e.tar.gz",
12+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13+
}
14+
}

0 commit comments

Comments
 (0)