ci: run more eb
tests
#1917
This file contains 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 | |
groovy_version: 4.x | |
jobs: | |
# build | |
############################################################################# | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
runner: | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- name: build | |
run: ./build-coatjava.sh --spotbugs --unittests --quiet -T4 | |
- 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 | |
- name: collect jacoco report | |
if: ${{ matrix.runner == 'ubuntu-latest' }} | |
run: validation/jacoco-aggregate.sh | |
- name: publish jacoco report | |
if: ${{ matrix.runner == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco_report | |
path: publish/ | |
retention-days: 1 | |
# tests | |
############################################################################# | |
test_coatjava: | |
needs: [ build ] | |
strategy: | |
fail-fast: false | |
matrix: | |
id: | |
- kpp | |
- eb-ep | |
- eb-eg | |
- eb-epC | |
- eb-enC | |
- eb-eFTpi | |
- eb-epi | |
- eb-ek | |
- eb-en | |
- eb-epiC | |
- eb-ekC | |
- eb-eFTp | |
runner: | |
- ubuntu-latest | |
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 } | |
- { id: eb-epi, cmd: ./run-eb-tests.sh -100 electronpion } | |
- { id: eb-ek, cmd: ./run-eb-tests.sh -100 electronkaon } | |
- { id: eb-en, cmd: ./run-eb-tests.sh -100 electronneutron } | |
- { id: eb-epiC, cmd: ./run-eb-tests.sh -100 electronpionC } | |
- { id: eb-ekC, cmd: ./run-eb-tests.sh -100 electronkaonC } | |
- { id: eb-eFTp, cmd: ./run-eb-tests.sh -100 electronFTproton } | |
# run one macos test | |
- { id: eb-ep, runner: macos-latest, cmd: ./run-eb-tests.sh -100 electronproton } | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build_${{ matrix.runner }} | |
- 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@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
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@v4 | |
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 | |
release: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: build_ubuntu-latest | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: coatjava.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
final: | |
needs: | |
- build | |
- test_coatjava | |
- test_run-groovy | |
- release | |
runs-on: ubuntu-latest | |
steps: | |
- name: pass | |
run: exit 0 | |
# generate documentation | |
############################################################################# | |
generate_documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.java_version }} | |
distribution: ${{ env.java_distribution }} | |
- name: build | |
run: ./build-coatjava.sh | |
- name: generate documentation | |
run: ./build-javadocs.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: javadoc | |
path: docs/javadoc/ | |
retention-days: 1 | |
# deploy web pages | |
############################################################################# | |
collect_webpages: | |
if: ${{ github.ref == 'refs/heads/development' }} | |
needs: [ build, generate_documentation ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: download jacoco report | |
uses: actions/download-artifact@v4 | |
with: | |
name: jacoco_report | |
path: pages/jacoco | |
- name: download javadoc documentation | |
uses: actions/download-artifact@v4 | |
with: | |
name: javadoc | |
path: pages/javadoc | |
- run: tree pages | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
retention-days: 1 | |
path: pages/ | |
deploy_web_pages: | |
if: ${{ github.ref == 'refs/heads/development' }} | |
needs: collect_webpages | |
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 |