More stringent check for installed JDK #232
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
# This workflow will build a Java project with Ant | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant | |
name: Java CI with Ant | |
on: | |
push: | |
branches: [ "master", "main" ] | |
pull_request: | |
branches: [ "master", "main" ] | |
env: | |
DEFAULT_DOCKER_ACCOUNT: apease | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: apease/sigma-ci:latest | |
steps: | |
- name: checkout sigmakee | |
uses: actions/checkout@v4 | |
with: | |
path: sigmakee | |
- name: checkout TPTP-ANTLR | |
uses: actions/checkout@v4 | |
with: | |
repository: 'ontologyportal/TPTP-ANTLR' | |
path: TPTP-ANTLR | |
- name: checkout SigmaUtils | |
uses: actions/checkout@v4 | |
with: | |
repository: 'ontologyportal/SigmaUtils' | |
path: SigmaUtils | |
- name: checkout sumo | |
uses: actions/checkout@v4 | |
with: | |
repository: 'ontologyportal/sumo' | |
path: sumo | |
- name: Setup SigmaKEE | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
working-directory: ${{ github.workspace }} | |
run: | | |
echo "SIGMA_HOME: $SIGMA_HOME" | |
echo "SIGMA_SRC: $SIGMA_SRC" | |
echo "ONTOLOGYPORTAL_GIT: $ONTOLOGYPORTAL_GIT" | |
mkdir -p $SIGMA_HOME/KBs/WordNetMappings | |
cp $SIGMA_SRC/config.xml $SIGMA_HOME/KBs | |
cp -R $ONTOLOGYPORTAL_GIT/sumo/* $SIGMA_HOME/KBs | |
cp /opt/WordNet-3.0/dict/* $SIGMA_HOME/KBs/WordNetMappings/ | |
sed -i "s|/home/theuser/.sigmakee|$SIGMA_HOME|g" $SIGMA_HOME/KBs/config.xml | |
sed -i "s|/home/theuser/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|g" $SIGMA_HOME/KBs/config.xml | |
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" $SIGMA_HOME/KBs/config.xml | |
- name: Set up JDK 21 for x64 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Build with Ant | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
run: ant | |
working-directory: ./sigmakee | |
- name: Prepare test env | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
working-directory: ./sigmakee | |
run: | | |
sed -i "s|/home/apease/.sigmakee|$SIGMA_HOME|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml | |
sed -i "s|/home/apease/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml | |
sed -i "s|/home/apease/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml | |
sed -i "s|/home/apease/workspace/vampire/vampire|/usr/local/bin/vampire|g" $SIGMA_SRC/test/unit/java/resources/config_topOnly.xml | |
- name: Run unit tests | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
working-directory: ./sigmakee | |
run: | | |
ant test.unit | |
- name: Setup SIGMA_HOME for integration tests | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
working-directory: ${{ github.workspace }} | |
run: | | |
find $SIGMA_HOME/KBs -name '*.ser' -delete | |
cp $SIGMA_SRC/config.xml $SIGMA_HOME/KBs | |
sed -i "s|/home/theuser/.sigmakee|$SIGMA_HOME|g" $SIGMA_HOME/KBs/config.xml | |
sed -i "s|/home/theuser/workspace/sumo|$ONTOLOGYPORTAL_GIT/sumo|g" $SIGMA_HOME/KBs/config.xml | |
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" $SIGMA_HOME/KBs/config.xml | |
sed -i "s|/home/theuser/workspace/vampire/vampire|/usr/local/bin/vampire|g" $SIGMA_HOME/KBs/config.xml | |
sed -i '/<kb name/,/<\/kb>/d' $SIGMA_HOME/KBs/config.xml | |
- name: Setup KB for integration tests | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
working-directory: ${{ github.workspace }} | |
run: > | |
sed -i '/<\/configuration>/i\ | |
<kb name="SUMO">\n | |
<constituent filename="Merge.kif"\/>\n | |
<constituent filename="Mid-level-ontology.kif"\/>\n | |
<constituent filename="english_format.kif"\/>\n | |
<constituent filename="domainEnglishFormat.kif"\/>\n | |
<\/kb>' $SIGMA_HOME/KBs/config.xml | |
- name: Run integration tests | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
SIGMA_SRC: ${{ github.workspace }}/sigmakee | |
ONTOLOGYPORTAL_GIT: ${{ github.workspace }} | |
working-directory: ./sigmakee | |
run: | | |
ant test.integration | |
- name: Prune KB after integration tests | |
env: | |
SIGMA_HOME: ${{ github.workspace }}/sigmakee-runtime | |
working-directory: ${{ github.workspace }} | |
run: | | |
find $SIGMA_HOME/KBs -name '*.ser' -delete | |
rm -rf $SIGMA_HOME/KBs/tests | |
- name: Upload sigmakee jars | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
./sigmakee/build/WEB-INF/lib/*.jar | |
./sigmakee/build/sigmakee.jar | |
./sigmakee/config.xml | |
./sigmakee-runtime | |
- name: Upload sigmakee war | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sigma-webapp | |
path: /usr/local/tomcat/webapps/sigma.war | |
build-sumo-ci: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
if: github.event_name == 'push' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Download artifact | |
uses: actions/[email protected] | |
with: | |
name: artifact | |
- name: Download artifact | |
uses: actions/[email protected] | |
with: | |
name: sigma-webapp | |
- name: Setup SigmaKEE | |
run: | | |
ls . | |
sed -i "s|/home/theuser/.sigmakee|/root/sigmakee-runtime|g" ./sigmakee/config.xml | |
sed -i "s|/home/theuser/workspace/vampire/vampire|/usr/local/bin/vampire|g" ./sigmakee/config.xml | |
sed -i "s|/home/theuser/E/bin/e_ltb_runner|/usr/local/bin/e_ltb_runner|g" ./sigmakee/config.xml | |
cp ./sigmakee/config.xml ./sigmakee-runtime/KBs | |
- name: Set image account name | |
env: | |
DOCKER_ACCOUNT: ${{ secrets.DOCKERHUB_USERNAME }} | |
run: | | |
echo "IMAGE_ACCOUNT=${DOCKER_ACCOUNT:-$DEFAULT_DOCKER_ACCOUNT}" >> $GITHUB_ENV | |
- name: Build and push sumo-ci | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: docker/sumo-ci/Dockerfile | |
build-args: | | |
IMAGE_ACCOUNT=${{ env.IMAGE_ACCOUNT }} | |
push: ${{ github.event_name == 'push' }} | |
tags: ${{ env.IMAGE_ACCOUNT }}/sumo-ci:latest | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build and push sigmakee | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: docker/sigmakee/Dockerfile | |
build-args: | | |
IMAGE_ACCOUNT=${{ env.IMAGE_ACCOUNT }} | |
push: ${{ github.event_name == 'push' }} | |
tags: ${{ env.IMAGE_ACCOUNT }}/sigmakee:latest | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |