Decoder speedups #1061
Workflow file for this run
This file contains hidden or 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
# https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Coatjava-CI | |
on: | |
pull_request: | |
push: | |
branches: [ development ] | |
tags: [ '*' ] | |
schedule: | |
# NOTE: From what I read, the email notification for cron can only go | |
# to the last committer of this file!!!!! | |
- cron: '0 22 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
java_version: 17 | |
java_distribution: zulu | |
javadoc_version: 24 # newer than `java_version` for better javadoc | |
groovy_version: 4.x | |
CCDB_CONNECTION: 'sqlite:////cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/noarch/data/ccdb/ccdb_latest.sqlite' | |
nthreads: 1 | |
jobs: | |
# download & cache | |
############################################################################# | |
download_test_data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
key: raw_test_data # fixed key will always hit; clear cache to trigger cache miss | |
path: clas_005038.evio.00000 | |
lookup-only: true | |
- name: install xrootd-client | |
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | |
run: | | |
sudo apt -y update | |
sudo apt -y install xrootd-client | |
- name: download | |
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | |
run: | | |
xrdcp xroot://sci-xrootd.jlab.org///osgpool/hallb/clas12/validation/clas_005038.evio.00000 ./ | |
# build | |
############################################################################# | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
runner: | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- name: install xrootd-client (linux) | |
if: ${{ matrix.runner == 'ubuntu-latest' }} | |
run: | | |
sudo apt -y update | |
sudo apt -y install xrootd-client | |
- name: install xrootd-client (macos) | |
if: ${{ matrix.runner == 'macos-latest' }} | |
run: brew install xrootd | |
- name: setup cvmfs | |
uses: cvmfs-contrib/github-action-cvmfs@v5 | |
with: | |
cvmfs_repositories: 'oasis.opensciencegrid.org' | |
- name: cvmfs | |
run: ls /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/sw/noarch/data/ccdb/ccdb_latest.sqlite | |
- name: bump version to tag if tag trigger | |
if: ${{ github.ref_type == 'tag' }} | |
run: libexec/version-bump.sh ${{ github.ref_name }} | |
- name: build | |
run: ./build-coatjava.sh --xrootd --no-progress -T${{ env.nthreads }} | |
- name: tar # tarball to preserve permissions | |
run: tar czvf coatjava.tar.gz coatjava | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: build_${{ matrix.runner }} | |
retention-days: 1 | |
path: coatjava.tar.gz | |
# tests | |
############################################################################# | |
unit_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- name: install xrootd-client | |
run: | | |
sudo apt -y update | |
sudo apt -y install xrootd-client | |
- uses: cvmfs-contrib/github-action-cvmfs@v5 | |
with: | |
cvmfs_repositories: 'oasis.opensciencegrid.org' | |
- name: unit tests and spotbugs | |
run: ./build-coatjava.sh --xrootd --spotbugs --unittests --no-progress -T${{ env.nthreads }} | |
- name: collect jacoco report | |
run: validation/jacoco-aggregate.sh | |
- name: publish jacoco report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco_report | |
path: publish/ | |
retention-days: 1 | |
test_decoder: | |
needs: [ build, download_test_data ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up JDK | |
uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- uses: cvmfs-contrib/github-action-cvmfs@v5 | |
with: | |
cvmfs_repositories: 'oasis.opensciencegrid.org' | |
- name: install xrootd-client | |
run: | | |
sudo apt -y update | |
sudo apt -y install xrootd-client | |
- uses: actions/download-artifact@v5 | |
with: | |
name: build_ubuntu-latest | |
- uses: actions/cache/restore@v4 | |
with: | |
key: raw_test_data | |
path: clas_005038.evio.00000 | |
- name: untar build | |
run: tar xzvf coatjava.tar.gz | |
- name: run test | |
run: | | |
./coatjava/bin/decoder -n 10000 -o dog.hipo ./clas_005038.evio.00000 | |
test_coatjava: | |
needs: [ build ] | |
strategy: | |
fail-fast: true | |
matrix: | |
runner: | |
- ubuntu-latest | |
id: | |
- kpp | |
- eb-ep | |
- eb-eg | |
- eb-epc | |
- eb-enc | |
- eb-eftpi | |
include: | |
# run all tests on ubuntu | |
- { id: kpp, cmd: ./run-advanced-tests.sh } | |
- { id: eb-ep, cmd: ./run-eb-tests.sh -100 electronproton } | |
- { id: eb-eg, cmd: ./run-eb-tests.sh -100 electrongamma } | |
- { id: eb-epc, cmd: ./run-eb-tests.sh -100 electronprotonC } | |
- { id: eb-enc, cmd: ./run-eb-tests.sh -100 electronneutronC } | |
- { id: eb-eftpi, cmd: ./run-eb-tests.sh -100 electronFTpion } | |
# run one macos test | |
- { runner: macos-latest, id: eb-ep, cmd: ./run-eb-tests.sh -100 electronproton } | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up JDK | |
uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- uses: actions/download-artifact@v5 | |
with: | |
name: build_${{ matrix.runner }} | |
- uses: cvmfs-contrib/github-action-cvmfs@v5 | |
with: | |
cvmfs_repositories: 'oasis.opensciencegrid.org' | |
- name: untar build | |
run: tar xzvf coatjava.tar.gz | |
- name: run test | |
run: | | |
cd validation/advanced-tests | |
echo "COMMAND: ${{ matrix.cmd }}" | |
${{ matrix.cmd }} | |
test_run-groovy: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up JDK | |
uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- name: setup groovy | |
uses: wtfjoke/setup-groovy@v2 | |
with: | |
groovy-version: ${{ env.groovy_version }} | |
- uses: actions/download-artifact@v5 | |
with: | |
name: build_ubuntu-latest | |
- name: untar build | |
run: tar xzvf coatjava.tar.gz | |
- name: test run-groovy | |
run: coatjava/bin/run-groovy validation/advanced-tests/test-run-groovy.groovy | |
dependency_analysis: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up JDK | |
uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- uses: actions/download-artifact@v5 | |
with: | |
name: build_ubuntu-latest | |
- name: untar build | |
run: tar xzvf coatjava.tar.gz | |
- name: print dependency tree | |
run: libexec/dependency-tree.sh | |
- name: dependency analysis | |
run: libexec/dependency-analysis.sh | |
# documentation | |
############################################################################# | |
generate_documentation: | |
runs-on: ubuntu-latest | |
needs: [ unit_tests ] | |
steps: | |
### mkdocs | |
- uses: actions/checkout@v5 | |
- name: install mkdocs dependencies | |
run: python -m pip install -r docs/mkdocs/requirements.txt | |
- name: generate mkdocs | |
run: docs/mkdocs/generate.sh pages | |
### jacoco | |
- name: download jacoco report artifact | |
uses: actions/download-artifact@v5 | |
with: | |
name: jacoco_report | |
path: pages/jacoco | |
### javadoc | |
- name: set up JDK | |
uses: actions/setup-java@v5 | |
with: | |
java-version: ${{ env.javadoc_version }} | |
distribution: ${{ env.java_distribution }} | |
- name: build coatjava javadocs # javadoc:aggregate output dir cannot be controlled, so assume the latest "standard" path and `mv` it | |
run: | | |
libexec/build-javadocs.sh | |
mv target/reports/apidocs pages/javadoc | |
### upload artifacts | |
- uses: actions/upload-pages-artifact@v4 | |
with: | |
retention-days: 7 | |
path: pages/ | |
deploy_web_pages: | |
if: ${{ github.ref == 'refs/heads/development' }} | |
needs: [ generate_documentation ] | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: deployment | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# finalize | |
############################################################################# | |
release_build: | |
if: ${{ github.ref_type == 'tag' }} | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO_URL: ${{ github.event.repository.html_url }} | |
RUN_ID: ${{ github.run_id }} | |
TAG_NAME: ${{ github.ref_name }} | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/download-artifact@v5 | |
with: | |
name: build_ubuntu-latest | |
- name: rename artifact | |
run: | | |
tar xzf coatjava.tar.gz | |
mv coatjava{,-${{ env.TAG_NAME }}} | |
tar czf coatjava-${{ env.TAG_NAME }}{.tar.gz,} | |
- name: release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: coatjava-${{ env.TAG_NAME }}.tar.gz | |
- name: open issue if failed | |
if: ${{ cancelled() || failure() }} | |
uses: JasonEtco/create-an-issue@v2 | |
with: | |
filename: .github/issue_release.md | |
final: | |
needs: | |
- test_coatjava | |
- dependency_analysis | |
- test_run-groovy | |
- generate_documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: pass | |
run: exit 0 |