diff --git a/.github/workflows/rubocop.yml b/.github/workflows/lint.yml similarity index 96% rename from .github/workflows/rubocop.yml rename to .github/workflows/lint.yml index 1c441355..912dce43 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Rubocop +name: Lint on: pull_request: branches: @@ -8,7 +8,7 @@ on: - master jobs: - lint: + rubocop: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..378af3de --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Test +on: + pull_request: + branches: + - '**' + push: + branches: + - master + +jobs: + rspec: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@preview + id: cache + with: + path: ~/local/rubies + key: 2.6.5 + + - uses: clupprich/ruby-build-action@master + id: ruby + with: + ruby-version: 2.6.5 + cache-available: ${{ steps.cache.outputs.cache-hit == 'true' }} + + - name: Setup sqlite3 + run: sudo apt-get install libsqlite3-dev + + - name: Install dependencies + run: bundle install + + - name: Migrate test database + run: bin/rails db:migrate RAILS_ENV=test + + - name: Run rspec + run: rake diff --git a/Rakefile b/Rakefile index 0303de94..41f4f9cd 100644 --- a/Rakefile +++ b/Rakefile @@ -34,3 +34,9 @@ begin rescue LoadError # rubocop:disable Lint/HandleExceptions # no rspec available end + +require 'rubocop/rake_task' + +RuboCop::RakeTask.new(:rubocop) do |t| + t.options = ['--display-cop-names'] +end diff --git a/spec/jobs/bulkrax/exporter_job_spec.rb b/spec/jobs/bulkrax/exporter_job_spec.rb index 266ae093..6bb0de13 100644 --- a/spec/jobs/bulkrax/exporter_job_spec.rb +++ b/spec/jobs/bulkrax/exporter_job_spec.rb @@ -12,6 +12,7 @@ module Bulkrax allow(Bulkrax::Exporter).to receive(:find).with(1).and_return(exporter) allow(exporter).to receive(:exporter_runs).and_return([bulkrax_exporter_run]) allow(exporter).to receive(:mapping).and_return("title" => {}) + exporter.setup_export_path end describe 'successful job', clean_downloads: true do diff --git a/tmp/exports/.gitkeep b/tmp/exports/.gitkeep new file mode 100644 index 00000000..e69de29b