Build Test Lint of 6744/merge by @dlpierce #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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: [4] | |
ci_node_index: [0,1,2,3] | |
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 }} | |
continue-on-error: true | |
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 | |
uses: jwalton/gh-docker-logs@v2 | |
with: | |
images: 'seleniarm/standalone-chromium' | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: '**/rspec*.xml' | |
fail_on_failure: true | |
require_passed_tests: true | |
detailed_summary: true | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: failure() | |
with: | |
limit-access-to-actor: true |