Skip to content

Commit

Permalink
Final step in build from forks work (#6881)
Browse files Browse the repository at this point in the history
Test Report now runs via workflow trigger. This allows it to run on forked branches and dependabot PRs.
  • Loading branch information
orangewolf authored Aug 8, 2024
1 parent ac2e231 commit e4f8a06
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 149 deletions.
145 changes: 0 additions & 145 deletions .github/workflows/build-test-lint.yml

This file was deleted.

52 changes: 48 additions & 4 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
bundler-cache: true
cache-version: 1
- name: Rubocop
run: echo "<?xml version='1.0'?><testsuites><testsuite name='rubocop' tests='1735' failures='0'/></testsuites>" >> rubocop.xml
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()
Expand All @@ -49,6 +49,24 @@ jobs:
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=.${{ matrix.ci_test_app }}
cache-from: type=gha
cache-to: type=gha, mode=max
context: .
target: hyrax-engine-dev
tags: samvera/${{ matrix.ci_test_app }}:latest,samvera/${{ matrix.ci_test_app }}:${{ github.sha }}
outputs: type=docker,dest=/tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar
- name: Upload built image artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.ci_test_app }}-image
path: /tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar

test:
needs: build
Expand All @@ -62,8 +80,34 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fake Run
run: echo "<?xml version='1.0'?><testsuites><testsuite name='rspec' tests='1735' failures='0'/></testsuites>" >> rspec.xml
- name: Setup tmate debug session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true
detached: true
- name: Download built image artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.ci_test_app }}-image
path: /tmp
- name: Start containers
run: |
docker load --input /tmp/${{ matrix.ci_test_app }}-${{ github.sha }}.tar
docker image ls -a
docker compose -f docker-compose-${{ matrix.ci_test_app }}.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-${{ matrix.ci_test_app }}.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:
Expand All @@ -72,7 +116,7 @@ jobs:
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
run: >-
mv rspec.xml rspec-${CI_TEST_APP}-${CI_NODE_INDEX}.xml
- name: Archive spec reports (${{ matrix.ci_node_index}})
- name: Archive spec reports
uses: actions/upload-artifact@v4
if: always()
with:
Expand Down

0 comments on commit e4f8a06

Please sign in to comment.