Skip to content

Commit

Permalink
add fake jobs to main so that events will trigger (#6871)
Browse files Browse the repository at this point in the history
* add fake jobs to main so that events will trigger

* dont double run the tests
  • Loading branch information
orangewolf authored Aug 6, 2024
1 parent 4b74958 commit 4693418
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 'Lint Build Test'
run-name: Link Build Test 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: echo "<?xml version='1.0'?><testsuites><testsuite name='rubocop' tests='1735' failures='0'/></testsuites>" >> rubocop.xml
- 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
strategy:
fail-fast: false
matrix:
ci_test_app: [dassie,koppie]
steps:
- name: Checkout
uses: actions/checkout@v4

test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ci_test_app: [dassie,koppie]
ci_node_total: [8]
ci_node_index: [0,1,2,3,4,5,6,7]
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: Move Test Files
if: always()
env:
CI_TEST_APP: ${{ matrix.ci_test_app }}
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
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}})
uses: actions/upload-artifact@v4
if: always()
with:
name: spec-reports-${{ matrix.ci_test_app }}-${{ matrix.ci_node_index }}
path: '**/rspec*.xml'

event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
40 changes: 40 additions & 0 deletions .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Results

on:
workflow_run:
workflows: ["Lint Build Test"]
types:
- completed
permissions: {}

jobs:
test-results:
name: Test Results Check
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write
# needed unless run with comment_mode: off
pull-requests: write
# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts
name: "*(report|Event)*"
name_is_regexp: true

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
action_fail_on_inconclusive: true
fail_on: "test failures"

0 comments on commit 4693418

Please sign in to comment.