Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Assets

on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * 0' # weekly

jobs:
assets:
timeout-minutes: 30
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: 2.6
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-pr-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-pr-
- name: Build assets
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rake assets:precompile
16 changes: 4 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_DB: ci_test
POSTGRES_PASSWORD: postgres
strategy:
matrix:
tests:
- name: 'assets'
args: 'ASSETS=true'
- name: 'tests'
args: 'ASSETS=false'

steps:
- uses: actions/checkout@v2
Expand All @@ -44,12 +36,12 @@ jobs:
- name: Test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
OXT_DB_USER: postgres
OXT_TEST_DB: ci_test
OXT_DB_PASS: postgres
OXE_DB_USER: postgres
OXE_DB_PASS: postgres
RAILS_ENV: test
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
${{ matrix.tests.args }} ./bin/ci
bundle exec rake parallel:create parallel:load_schema parallel:seed --trace
bundle exec parallel_rspec ./spec
45 changes: 0 additions & 45 deletions app/routines/attach_file.rb

This file was deleted.

13 changes: 0 additions & 13 deletions bin/ci

This file was deleted.

19 changes: 9 additions & 10 deletions spec/representers/api/v1/exercises/representer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,16 @@ module Api::V1::Exercises
end

it 'only attaches when not already attached' do
# attempt to attach an image that is already attached
representer = described_class.new(exercise)
expect {
# attempt to attach an image that is already attached
representer = described_class.new(exercise)
expect {
representer.from_hash('images' => [
{ 'signed_id' => exercise.images[0].signed_id },
{ 'signed_id' => exercise.images[0].signed_id },
]
)
exercise.save
}.not_to change { exercise.images.count }
representer.from_hash('images' => [
{ 'signed_id' => exercise.images[0].signed_id },
{ 'signed_id' => exercise.images[0].signed_id },
]
)
exercise.save
}.not_to change { exercise.images.count }
end

end
Expand Down
57 changes: 0 additions & 57 deletions spec/routines/attach_file_spec.rb

This file was deleted.