Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache dependencies #40

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,59 @@ on:
branches: [ master ]

jobs:
build:

setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.0 and install dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.1
bundler-cache: true
- name: Compile
run: |
bundle exec rake precompile:spec
- name: Cache
uses: actions/cache@v2
with:
path: |
build
public
key: Cache-${{ github.sha }}

RuboCop:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.0
uses: actions/setup-ruby@v1
- name: Set up Ruby 3.0 and install dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.1
bundler-cache: true
- name: RuboCop
run: |
bundle exec rubocop

Spec1:
needs: setup
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.0 and install dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.1
bundler-cache: true
- name: Cache
uses: actions/cache@v2
with:
ruby-version: 3.0.x
- name: Build and test with Rake
path: |
build
public
key: Cache-${{ github.sha }}
- name: Test Thing
run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake
bundle exec rspec spec/assets_spec.rb
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ task :precompile do
assets.clean_intermediate_output_files
end

task :'precompile:spec' do
require_relative 'lib/assets'
assets = Assets.new(compress: false, gzip: false, cache: true, precompiled: false)
assets.combine
end

desc 'Profile loading data'
task 'stackprof', [:json] do |_task, args|
require 'stackprof'
Expand Down