Skip to content

Commit 3b587b9

Browse files
authored
ci: replace clas12-validation dispatch with reusable workflow (JeffersonLab#146)
1 parent 4724bd1 commit 3b587b9

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

.github/workflows/validation.yml

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,16 @@
1-
name: Dispatch Validation
1+
name: Validation
22

33
on:
44
pull_request:
55
push:
66
branches: [ development ]
77
tags: [ '*' ]
8+
workflow_dispatch:
89

910
concurrency:
1011
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1112
cancel-in-progress: true
1213

13-
env:
14-
# number of events; use 0 for the default in `clas12-validation`
15-
num_events_low_stats: 0
16-
num_events_high_stats: 1000
17-
1814
jobs:
19-
20-
clas12-validation:
21-
name: clas12-validation dispatch
22-
runs-on: ubuntu-latest
23-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' }} # not a PR from a fork || is a push
24-
steps:
25-
- name: sanitize message
26-
id: sanitize
27-
run: echo title=$(echo '${{ github.event.pull_request.title || github.event.head_commit.message }}' | head -n1 | sed 's;";;g' | sed "s;';;g") >> $GITHUB_OUTPUT
28-
- name: set number of events
29-
id: num_events
30-
run: |
31-
# use low stats for PR commits, or high stats for pushes (which should only be PR merges)
32-
[ "${{ github.event_name }}" = "push" ] && num_events=${{ env.num_events_high_stats }} || num_events=${{ env.num_events_low_stats }}
33-
echo num_events=$num_events >> $GITHUB_OUTPUT
34-
- name: dispatch
35-
uses: c-dilks/trigger-workflow-and-wait@master # convictional/[email protected]
36-
with:
37-
owner: JeffersonLab
38-
repo: clas12-validation
39-
summarize: true
40-
github_token: ${{ secrets.CLAS12VALIDATION }}
41-
workflow_file_name: ci.yml
42-
ref: main
43-
client_payload: >-
44-
{
45-
"num_events": "${{ steps.num_events.outputs.num_events }}",
46-
"actor": "${{ github.actor }}",
47-
"source": "${{ github.event.repository.name }}",
48-
"title": "${{ steps.sanitize.outputs.title }}",
49-
"source_url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
50-
"git_${{ github.event.repository.name }}": "{\"fork\": \"${{ github.repository }}\", \"branch\": \"${{ github.head_ref || github.ref_name }}\" }"
51-
}
15+
validation:
16+
uses: JeffersonLab/clas12-validation/.github/workflows/ci.yml@main

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coatjava
22
[![Build Status](https://github.com/jeffersonlab/coatjava/workflows/Coatjava-CI/badge.svg)](https://github.com/jeffersonlab/coatjava/actions)
3-
[![Validation Status](https://github.com/JeffersonLab/clas12-validation/actions/workflows/ci.yml/badge.svg)](https://github.com/JeffersonLab/clas12-validation/actions/workflows/ci.yml)
3+
[![Validation Status](https://github.com/JeffersonLab/coatjava/actions/workflows/validation.yml/badge.svg)](https://github.com/JeffersonLab/coatjava/actions/workflows/validation.yml)
44
[![codecov](https://codecov.io/gh/JeffersonLab/coatjava/branch/development/graph/badge.svg?precision=2)](https://codecov.io/gh/JeffersonLab/coatjava/branch/development)
55

66
The original repository for COATJAVA was named "clas12-offline-software" and is [now archived and read-only](https://github.com/JeffersonLab/clas12-offline-software). On May 17, 2023, this new repository was created by running BFG Repo Cleaner to get rid of old, large data files and things that should never have been in the repository, giving 10x reduction in repository size, clone time, etc, and renamed "coatjava". The most critical, github-specific aspects have been transferred to this new repository:

0 commit comments

Comments
 (0)