Skip to content

Commit

Permalink
synced from main
Browse files Browse the repository at this point in the history
  • Loading branch information
maureeungaro committed Nov 14, 2024
2 parents b701ac8 + e6d76e2 commit 8d0a1a9
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
23 changes: 23 additions & 0 deletions .github/workflows/validation-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validation-dev

on:
pull_request:
branches: [ dev ] # PRs which target `dev`
push:
branches: [ dev ] # pushes on `dev` (and merging PRs to `dev`)
workflow_dispatch: # manual trigger

jobs:
validation:
uses: JeffersonLab/clas12-validation/.github/workflows/ci.yml@main
with:
gemc_version: build
config_file_versions: >-
{
"coatjava": "latest",
"gemc": "dev"
}
git_upstream: >-
{
"clas12Tags": { "fork": "gemc/clas12Tags", "ref": "dev" }
}
9 changes: 6 additions & 3 deletions .github/workflows/validation-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: Validation-latest

on:
pull_request:
branches-ignore: [ dev ] # PRs which do not target `dev` (cf. `validation-dev.yml`)
push:
branches: [ main ]
tags: [ '*' ]
workflow_dispatch:
branches: [ main ] # pushes on `main` (viz., merging PRs to `main`)
tags: [ '*' ] # any tags
workflow_dispatch: # manual trigger

jobs:
validation:
uses: JeffersonLab/clas12-validation/.github/workflows/ci.yml@main
with:
gemc_version: match_gcard
2 changes: 1 addition & 1 deletion coatjava/10.1.1/rge_spring2024_LD2-Al-liq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
name: MC
configuration:
global:
variation: rgb_spring2019_mc
variation: rga_fall2018_mc
# timestamp: 07/27/2023-12:00:00
# uncomment to use bank filtering based on schema, schema path should be updated
# to point to the correct coatjava folder
Expand Down
37 changes: 27 additions & 10 deletions util/latest.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/usr/bin/env ruby

unless ARGV.length == 2
$stderr.puts """USAGE: #{$0} [SUBDIRECTORY] [CONFIG_BASENAME]
- obtain the latest version of the config file with basename [CONFIG] from
if ARGV.length < 2
$stderr.puts """USAGE: #{$0} [SUBDIRECTORY] [CONFIG_BASENAME] [OUTPUT]
- obtain the latest version of the config file with basename [CONFIG] from
[SUBDIRECTORY], assuming [SUBDIRECTORY] contains subdirectories of tag names
- tag names that are not semantic version numbers, such as `dev`, are ignored
- [OUTPUT] may be either:
'file': return the file name (default behavior)
'version': return just the version number
'both': return both file name and version number
"""
exit 2
end

subdir, config = ARGV
subdir, config = ARGV[0..1]
output = ARGV.length >= 3 ? ARGV[2] : 'file'
unless Dir.exist? subdir
$stderr.puts "ERROR: subdirectory '#{subdir}' does not exist"
exit 1
Expand All @@ -35,17 +40,29 @@
end

# find the config files with the requested basename
configFiles = tagdirs.map{ |v|
Dir.glob("#{subdir}/#{v}/*").find{ |f|
results = Array.new
tagdirs.each do |v|
configFile = Dir.glob("#{subdir}/#{v}/*").find{ |f|
File.basename(f).match? /^#{config}\./
}
}
.compact
results << { :version=>v, :file=>configFile } unless configFile.nil?
end

if configFiles.empty?
if results.empty?
$stderr.puts "ERROR: cannot find config file with basename '#{config}' in any versioned subdirectory of '#{subdir}'"
exit 1
end

# return the latest version of that config file
puts configFiles.first
result = results.first
case output
when 'file'
puts result[:file]
when 'version'
puts result[:version]
when 'both'
puts result[:file] + ' ' + result[:version]
else
$stderr.puts "ERROR: unknown [OUTPUT] '#{output}'"
exit 1
end

0 comments on commit 8d0a1a9

Please sign in to comment.