Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed May 17, 2024
2 parents 8acfb1f + 42eccf4 commit 288699e
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 213 deletions.
181 changes: 0 additions & 181 deletions .circleci/config.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .dassie/.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ FCREPO_PORT=8080
FCREPO_REST_PATH=rest
FCREPO_TEST_BASE_PATH=/test
FITS_SERVLET_URL=http://fits:8080/fits
HUB_URL=http://chrome:4444/wd/hub
HUB_URL=http://chrome:4444
HYRAX_ANALYTICS=false
HYRAX_ANALYTICS_PROVIDER=google
HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
IN_DOCKER=true
KARMA_BROWSER=remote-chromium
KARMA_HOSTNAME=app
KARMA_HOSTNAME=web
MEMCACHED_HOST=memcached
RACK_ENV=development
RAILS_ENV=development
Expand All @@ -35,5 +35,7 @@ SOLR_HOST=solr
SOLR_PORT=8983
SOLR_TEST_URL=http://solr:8983/solr/hyrax_test
SOLR_URL=http://solr:8983/solr/hyrax
TB_RSPEC_OPTIONS=--force-color --format RspecJunitFormatter --out rspec.xml
TB_RSPEC_FORMATTER=progress
VALKYRIE_SOLR_HOST=solr
VALKYRIE_SOLR_PORT=8983
137 changes: 137 additions & 0 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: 'Build Test Lint'
run-name: Build Test Lint of ${{ github.ref_name }} by @${{ github.actor }}
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false

env:
REGISTRY: ghcr.io
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
cache-version: 1
- name: Rubocop
run: bundle install && bundle exec rubocop --parallel --format progress --format junit --out rubocop.xml --display-only-failed
- name: Archive rubocop reports
uses: actions/upload-artifact@v4
if: always()
with:
name: rubocop-reports
path: 'rubocop*.xml'

build:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export
uses: docker/build-push-action@v5
with:
build-args: |
APP_PATH=.koppie
cache-from: type=gha
cache-to: type=gha, mode=max
context: .
target: hyrax-engine-dev
tags: samvera/koppie:latest,samvera/koppie:${{ github.sha }}
outputs: type=docker,dest=/tmp/koppie-${{ github.sha }}.tar
- name: Upload built image artifact
uses: actions/upload-artifact@v4
with:
name: koppie-image
path: /tmp/koppie-${{ github.sha }}.tar

test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ci_node_total: [8]
ci_node_index: [0,1,2,3,4,5,6,7]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download built image artifact
uses: actions/download-artifact@v4
with:
name: koppie-image
path: /tmp
- name: Start containers
run: |
docker load --input /tmp/koppie-${{ github.sha }}.tar
docker image ls -a
docker compose -f docker-compose-koppie.yml up -d --quiet-pull --pull missing --no-build
- name: RSpec
env:
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
run: >-
docker compose -f docker-compose-koppie.yml exec -T -w /app/samvera/hyrax-engine web sh -c
"bundle install && yarn install && rspec_booster --job ${{ matrix.ci_node_index }}/${{ matrix.ci_node_total }}"
- name: Capture Container Logs
if: always()
uses: jwalton/gh-docker-logs@v2
with:
images: 'seleniarm/standalone-chromium'
- name: Move Test Files
if: always()
env:
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
run: >-
mv rspec.xml rspec-${CI_NODE_INDEX}.xml
- name: Archive spec reports
uses: actions/upload-artifact@v4
if: always()
with:
name: spec-reports-${{ matrix.ci_node_index }}
path: '**/rspec*.xml'
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: failure()
with:
limit-access-to-actor: true

report:
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
# only needed unless run with comment_mode: off
pull-requests: write
if: always()
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Test Report
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "artifacts/**/*.xml"
action_fail_on_inconclusive: true
fail_on: "test failures"
8 changes: 5 additions & 3 deletions .koppie/.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
HYRAX_VALKYRIE=true
IN_DOCKER=true
KARMA_BROWSER=remote-chromium
KARMA_HOSTNAME=app
KARMA_HOSTNAME=web
MEMCACHED_HOST=memcached
METADATA_DATABASE_NAME=koppie_metadata_development
POSTGRES_DB=koppie
Expand All @@ -30,7 +30,7 @@ POSTGRES_USER=hyrax_user
RACK_ENV=development
RAILS_ENV=development
RAILS_ROOT=.koppie
RAILS_LOG_TO_STDOUT=true
RAILS_LOG_TO_STDOUT=false
RAILS_QUEUE=sidekiq
REDIS_HOST=redis
REDIS_PASSWORD=sidekickin
Expand All @@ -43,6 +43,8 @@ SOLR_CORES=koppie
SOLR_HOST=solr
SOLR_PORT=8983
SOLR_URL=http://solr:8983/solr/koppie
SOLR_TEST_URL=http://solr:8983/solr/hydra-test
SOLR_TEST_URL=http://solr:8983/solr/koppie-test
TB_RSPEC_OPTIONS="--format RspecJunitFormatter --out rspec.xml"
TB_RSPEC_FORMATTER=progress
VALKYRIE_METADATA_ADAPTER=pg_metadata
VALKYRIE_STORAGE_ADAPTER=versioned_disk_storage
2 changes: 1 addition & 1 deletion .koppie/config/solr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
development:
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg-solr-dev" %>
test: &test
url: <%= ENV['TEST_SOLR_URL'] ||ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
url: <%= ENV['SOLR_TEST_URL'] ||ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/nurax-pg-test" %>
production:
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/nurax-pg" %>
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apk --no-cache upgrade && \
$EXTRA_APK_PACKAGES

RUN setfacl -d -m o::rwx /usr/local/bundle && \
gem update --system $RUBYGEMS_VERSION
gem update --silent --system $RUBYGEMS_VERSION

RUN addgroup -S --gid 101 app && \
adduser -S -G app -u 1001 -s /bin/sh -h /app app
Expand Down Expand Up @@ -111,7 +111,7 @@ RUN bundle -v && \
bundle install --jobs "$(nproc)" && \
cd $HYRAX_ENGINE_PATH && \
bundle install --jobs "$(nproc)" && \
yarn
yarn && yarn cache clean

RUN RAILS_ENV=production SECRET_KEY_BASE='fakesecret1234' DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile

Expand Down
Loading

0 comments on commit 288699e

Please sign in to comment.