Bump to version 0.1.8. #2591
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
| name: Build | |
| on: [push] | |
| permissions: | |
| actions: read | |
| contents: read | |
| jobs: | |
| paper: | |
| runs-on: ubuntu-latest | |
| name: Build Paper | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Build JOSS preview | |
| uses: openjournals/openjournals-draft-action@85a18372e48f551d8af9ddb7a747de685fbbb01c # v1.0 (2024-07-17) | |
| with: | |
| journal: joss | |
| paper-path: paper/paper.md | |
| - name: Upload JOSS preview | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 (2025-12-12) | |
| with: | |
| name: paper | |
| path: paper/paper.pdf | |
| lintJs: | |
| runs-on: ubuntu-latest | |
| name: JS Lint | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup pnpm | |
| run: npm install -g pnpm@8 | |
| - name: Install node deps | |
| run: pnpm install | |
| working-directory: ./editor | |
| - name: Lint production code | |
| run: pnpm exec eslint ./js/*.js | |
| working-directory: ./editor | |
| - name: Lint test code | |
| run: pnpm exec eslint ./test/*.js | |
| working-directory: ./editor | |
| checkCacheBusters: | |
| runs-on: ubuntu-latest | |
| name: Cache Busters Check | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Setup pnpm | |
| run: npm install -g pnpm@8 | |
| - name: Install node deps | |
| run: pnpm install | |
| working-directory: ./editor | |
| - name: Build | |
| run: bash ./support/make.sh | |
| working-directory: ./editor | |
| - name: Prepare deploy | |
| run: bash ./support/prepare_deploy.sh | |
| working-directory: ./editor | |
| - name: Copy guide | |
| run: cp -r ./docs/guide ./editor/deploy/guide | |
| - name: Update cache busters | |
| run: bash ./support/update_version.sh | |
| working-directory: ./editor | |
| buildEngine: | |
| environment: build | |
| runs-on: ubuntu-latest | |
| name: JVM Engine Build | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Build fat jar | |
| run: ./gradlew fatJar | |
| - name: Install sshpass | |
| run: sudo apt-get install -y sshpass | |
| - name: Upload fatJar to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| sshpass -e ssh -o StrictHostKeyChecking=no \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }} \ | |
| "mkdir -p ./build.kigalisim.org/artifacts/${{ github.sha }}/fatJar" | |
| sshpass -e scp -o StrictHostKeyChecking=no \ | |
| build/libs/kigalisim-fat.jar \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/fatJar/kigalisim-fat.jar | |
| checkEngine: | |
| needs: buildEngine | |
| runs-on: ubuntu-latest | |
| name: Static Engine Checks | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Check grammar | |
| run: ./gradlew generateGrammarSource | |
| - name: Check main style | |
| run: ./gradlew checkstyleMain | |
| - name: Check test style | |
| run: ./gradlew checkstyleTest | |
| testEngine: | |
| needs: buildEngine | |
| runs-on: ubuntu-latest | |
| name: Engine Tests | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Run tests | |
| run: ./gradlew test | |
| runEngineLocal: | |
| needs: buildEngine | |
| runs-on: ubuntu-latest | |
| name: Run Engine Locally | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Download fatJar | |
| run: | | |
| mkdir -p build/libs | |
| curl -o build/libs/kigalisim-fat.jar \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/fatJar/kigalisim-fat.jar | |
| - name: Run example QTA file with CSV export | |
| run: java -jar build/libs/kigalisim-fat.jar run ../examples/minimal_interpreter.qta -o /tmp/minimal_interpreter.csv | |
| - name: Check CSV file was created and is non-empty | |
| run: | | |
| if [ ! -f /tmp/minimal_interpreter.csv ]; then | |
| echo "ERROR: CSV file was not created" | |
| exit 1 | |
| fi | |
| if [ ! -s /tmp/minimal_interpreter.csv ]; then | |
| echo "ERROR: CSV file is empty" | |
| exit 1 | |
| fi | |
| echo "SUCCESS: CSV file was created and is non-empty" | |
| echo "CSV file contents:" | |
| cat /tmp/minimal_interpreter.csv | |
| runMonteCarloReplicates: | |
| needs: [ checkEngine, testEngine, runEngineLocal ] | |
| runs-on: ubuntu-latest | |
| name: Run Monte Carlo Replicates Test | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Download fatJar | |
| run: | | |
| mkdir -p build/libs | |
| curl -o build/libs/kigalisim-fat.jar \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/fatJar/kigalisim-fat.jar | |
| - name: Run Monte Carlo simulation with 100 replicates and normal distribution | |
| run: java -jar build/libs/kigalisim-fat.jar run ../examples/test_monte_carlo_replicates.qta -o /tmp/monte_carlo_replicates.csv -r 100 | |
| - name: Check CSV file was created and is non-empty | |
| run: | | |
| if [ ! -f /tmp/monte_carlo_replicates.csv ]; then | |
| echo "ERROR: CSV file was not created" | |
| exit 1 | |
| fi | |
| if [ ! -s /tmp/monte_carlo_replicates.csv ]; then | |
| echo "ERROR: CSV file is empty" | |
| exit 1 | |
| fi | |
| echo "SUCCESS: CSV file was created and is non-empty" | |
| echo "Number of lines in CSV:" | |
| wc -l /tmp/monte_carlo_replicates.csv | |
| echo "First 10 lines of CSV file:" | |
| head -10 /tmp/monte_carlo_replicates.csv | |
| buildWasm: | |
| environment: build | |
| needs: [ checkEngine, buildEngine, testEngine, runEngineLocal ] | |
| runs-on: ubuntu-latest | |
| name: WASM Engine Build | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Build war | |
| run: ./gradlew warUnversioned | |
| - name: Install sshpass | |
| run: sudo apt-get install -y sshpass | |
| - name: Upload war to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| sshpass -e ssh -o StrictHostKeyChecking=no \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }} \ | |
| "mkdir -p ./build.kigalisim.org/artifacts/${{ github.sha }}/war" | |
| sshpass -e scp -o StrictHostKeyChecking=no \ | |
| build/libs/KigaliSim.war \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/war/KigaliSim.war | |
| unitTestsBrowser: | |
| runs-on: ubuntu-latest | |
| name: Web Tests | |
| needs: [ buildWasm ] | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Setup pnpm | |
| run: npm install -g pnpm@8 | |
| - name: Download war | |
| run: | | |
| curl -o ./KigaliSim.war \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/war/KigaliSim.war | |
| - name: Install node deps | |
| run: pnpm install | |
| working-directory: ./editor | |
| - name: Build | |
| run: bash ./support/make.sh | |
| working-directory: ./editor | |
| - name: Install browser | |
| run: sudo apt install -y chromium-browser | |
| - name: Run unit tests | |
| run: pnpm exec grunt | |
| working-directory: ./editor | |
| - name: Smoke test IDE for JS errors | |
| run: node support/smoke_ide.js | |
| working-directory: ./editor | |
| generateJavadoc: | |
| environment: build | |
| runs-on: ubuntu-latest | |
| name: Generate JavaDoc | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./engine | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Generate Javadoc | |
| run: ./gradlew javadoc | |
| - name: Install sshpass | |
| run: sudo apt-get install -y sshpass | |
| - name: Upload javadoc to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| sshpass -e ssh -o StrictHostKeyChecking=no \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }} \ | |
| "mkdir -p ./build.kigalisim.org/artifacts/${{ github.sha }}/javadoc" | |
| sshpass -e scp -r -o StrictHostKeyChecking=no \ | |
| build/docs/javadoc/. \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/javadoc/ | |
| - name: Upload javadoc zip to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| cd build/docs/javadoc && zip -r /tmp/javadoc.zip . | |
| sshpass -e scp -o StrictHostKeyChecking=no \ | |
| /tmp/javadoc.zip \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/javadoc.zip | |
| generateGuideMd: | |
| environment: build | |
| runs-on: ubuntu-latest | |
| name: Generate Guide Markdown | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Install Pandoc | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pandoc | |
| - name: Convert HTML guide to GFM markdown | |
| run: | | |
| mkdir -p docs/guide/md | |
| for html_file in docs/guide/*.html; do | |
| filename=$(basename "$html_file" .html) | |
| pandoc "$html_file" \ | |
| --from html \ | |
| --to gfm \ | |
| -o "docs/guide/md/${filename}.md" | |
| done | |
| - name: Install sshpass | |
| run: sudo apt-get install -y sshpass | |
| - name: Upload guide markdown to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| cd docs/guide/md && zip -r /tmp/guide-md.zip . | |
| sshpass -e ssh -o StrictHostKeyChecking=no \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }} \ | |
| "mkdir -p ./build.kigalisim.org/artifacts/${{ github.sha }}" | |
| sshpass -e scp -o StrictHostKeyChecking=no \ | |
| /tmp/guide-md.zip \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/guide-md.zip | |
| generateJsdoc: | |
| environment: build | |
| runs-on: ubuntu-latest | |
| name: Generate JSDoc | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./editor | |
| steps: | |
| - name: Checkout | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup pnpm | |
| run: npm install -g pnpm@8 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Generate JSDoc | |
| run: pnpm exec jsdoc -c jsdoc.json | |
| - name: Install sshpass | |
| run: sudo apt-get install -y sshpass | |
| - name: Upload jsdoc to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| sshpass -e ssh -o StrictHostKeyChecking=no \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }} \ | |
| "mkdir -p ./build.kigalisim.org/artifacts/${{ github.sha }}/jsdoc" | |
| sshpass -e scp -r -o StrictHostKeyChecking=no \ | |
| build/docs/jsdoc/. \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/jsdoc/ | |
| - name: Upload jsdoc zip to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| cd build/docs/jsdoc && zip -r /tmp/jsdoc.zip . | |
| sshpass -e scp -o StrictHostKeyChecking=no \ | |
| /tmp/jsdoc.zip \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/jsdoc.zip | |
| deployPrep: | |
| environment: build | |
| runs-on: ubuntu-latest | |
| name: Deploy Prep | |
| needs: [ lintJs, unitTestsBrowser, checkCacheBusters, buildWasm, runMonteCarloReplicates, generateJavadoc, generateGuideMd, generateJsdoc ] | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Setup pnpm | |
| run: npm install -g pnpm@8 | |
| - name: Install SSH client and sshpass | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y openssh-client sshpass | |
| - name: Download war | |
| run: | | |
| curl -o ./KigaliSim.war \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/war/KigaliSim.war | |
| - name: Download fatJar | |
| run: | | |
| curl -o ./kigalisim-fat.jar \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/fatJar/kigalisim-fat.jar | |
| - name: Install node deps | |
| run: pnpm install | |
| working-directory: ./editor | |
| - name: Build | |
| run: bash ./support/make.sh | |
| working-directory: ./editor | |
| - name: Prepare deploy | |
| run: bash ./support/prepare_deploy.sh | |
| working-directory: ./editor | |
| - name: Download guide markdown | |
| run: | | |
| curl -o /tmp/guide-md.zip \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/guide-md.zip | |
| mkdir -p ./docs/guide/md | |
| unzip -q /tmp/guide-md.zip -d ./docs/guide/md/ | |
| - name: Copy guide | |
| run: cp -r ./docs/guide ./editor/deploy/guide | |
| - name: Download webm files from archive | |
| run: bash ./docs/script/fetch_webm.sh ./editor/deploy/webm | |
| - name: Copy humans.txt to deploy root | |
| run: cp ./humans.txt ./editor/deploy/humans.txt | |
| - name: Download Javadoc | |
| run: | | |
| curl -o /tmp/javadoc.zip \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/javadoc.zip | |
| mkdir -p ./editor/deploy/guide/javadoc | |
| unzip -q /tmp/javadoc.zip -d ./editor/deploy/guide/javadoc/ | |
| - name: Download JSDoc | |
| run: | | |
| curl -o /tmp/jsdoc.zip \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/jsdoc.zip | |
| mkdir -p ./editor/deploy/guide/jsdoc | |
| unzip -q /tmp/jsdoc.zip -d ./editor/deploy/guide/jsdoc/ | |
| - name: Copy case study QTA file to guide | |
| run: cp ./examples/case_study.qta ./editor/deploy/guide/case_study.qta | |
| - name: Copy tutorial QTA files to guide | |
| run: | | |
| cp ./examples/tutorial_02.qta ./editor/deploy/guide/tutorial_02.qta | |
| cp ./examples/tutorial_03.qta ./editor/deploy/guide/tutorial_03.qta | |
| cp ./examples/tutorial_04.qta ./editor/deploy/guide/tutorial_04.qta | |
| cp ./examples/tutorial_05.qta ./editor/deploy/guide/tutorial_05.qta | |
| cp ./examples/tutorial_06.qta ./editor/deploy/guide/tutorial_06.qta | |
| cp ./examples/tutorial_07.qta ./editor/deploy/guide/tutorial_07.qta | |
| cp ./examples/tutorial_08.qta ./editor/deploy/guide/tutorial_08.qta | |
| cp ./examples/tutorial_09.qta ./editor/deploy/guide/tutorial_09.qta | |
| cp ./examples/tutorial_10.qta ./editor/deploy/guide/tutorial_10.qta | |
| cp ./examples/tutorial_12.qta ./editor/deploy/guide/tutorial_12.qta | |
| cp ./examples/tutorial_13.qta ./editor/deploy/guide/tutorial_13.qta | |
| cp ./examples/tutorial_14.qta ./editor/deploy/guide/tutorial_14.qta | |
| cp ./examples/tutorial_15.qta ./editor/deploy/guide/tutorial_15.qta | |
| cp ./examples/tutorial_17.qta ./editor/deploy/guide/tutorial_17.qta | |
| - name: Copy tutorial data files to guide | |
| run: cp ./examples/tutorial_11a.xlsx ./editor/deploy/guide/tutorial_11a.xlsx | |
| - name: Copy WASM files | |
| run: cp -r ./editor/wasm ./editor/deploy/wasm | |
| - name: Copy fat JAR | |
| run: cp ./kigalisim-fat.jar ./editor/deploy/kigalisim-fat.jar | |
| - name: Update cache busters | |
| run: bash ./support/update_version.sh | |
| working-directory: ./editor | |
| - name: Upload deploy-files to SFTP | |
| env: | |
| SSHPASS: ${{ secrets.BUILDSFTPPASSWORD }} | |
| run: | | |
| cd ./editor/deploy && zip -r /tmp/deploy-files.zip . | |
| sshpass -e ssh -o StrictHostKeyChecking=no \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }} \ | |
| "mkdir -p ./build.kigalisim.org/artifacts/${{ github.sha }}" | |
| sshpass -e scp -o StrictHostKeyChecking=no \ | |
| /tmp/deploy-files.zip \ | |
| ${{ secrets.BUILDSFTPUSER }}@${{ secrets.BUILDSFTPHOST }}:./build.kigalisim.org/artifacts/${{ github.sha }}/deploy-files.zip | |
| deployPreview: | |
| environment: deploy | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| name: Preview Deploy | |
| needs: [deployPrep] | |
| steps: | |
| - name: Install SSH client and sshpass | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y openssh-client sshpass | |
| - name: Setup SSH known hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| ssh-keyscan -H -p 22 ${{ secrets.SFTPHOST }} >> ~/.ssh/known_hosts | |
| - name: Download deploy-files | |
| run: | | |
| curl -o /tmp/deploy-files.zip \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/deploy-files.zip | |
| mkdir -p ./deploy | |
| unzip -q /tmp/deploy-files.zip -d ./deploy/ | |
| - name: Upload files via SCP | |
| env: | |
| SSHPASS: ${{ secrets.SFTPPASSWORD }} | |
| run: | | |
| sshpass -e scp -r -P 22 -o StrictHostKeyChecking=no \ | |
| ./deploy/* \ | |
| ${{ secrets.SFTPUSER }}@${{ secrets.SFTPHOST }}:./preview.kigalisim.org/ | |
| deploy: | |
| environment: deploy | |
| if: github.ref == 'refs/heads/deploy' | |
| runs-on: ubuntu-latest | |
| name: Production Deploy | |
| needs: [deployPrep] | |
| steps: | |
| - name: Install SSH client and sshpass | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y openssh-client sshpass | |
| - name: Setup SSH known hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| ssh-keyscan -H -p 22 ${{ secrets.SFTPHOST }} >> ~/.ssh/known_hosts | |
| - name: Download deploy-files | |
| run: | | |
| curl -o /tmp/deploy-files.zip \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/deploy-files.zip | |
| mkdir -p ./deploy | |
| unzip -q /tmp/deploy-files.zip -d ./deploy/ | |
| - name: Upload files via SCP | |
| env: | |
| SSHPASS: ${{ secrets.SFTPPASSWORD }} | |
| run: | | |
| sshpass -e scp -r -P 22 -o StrictHostKeyChecking=no \ | |
| ./deploy/* \ | |
| ${{ secrets.SFTPUSER }}@${{ secrets.SFTPHOST }}:./kigalisim.org/ | |
| runEngineDockerSanity: | |
| if: github.ref == 'refs/heads/deploy' | |
| runs-on: ubuntu-latest | |
| name: Docker Prod Check | |
| needs: [deploy] | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Build Docker image | |
| run: docker build -t kigalisim . | |
| - name: Run example QTA file via Docker | |
| run: docker run -v $(pwd)/examples:/working kigalisim run -o /working/minimal_interpreter_docker.csv /working/minimal_interpreter.qta | |
| - name: Check CSV file was created and is non-empty | |
| run: | | |
| if [ ! -f examples/minimal_interpreter_docker.csv ]; then | |
| echo "ERROR: CSV file was not created" | |
| exit 1 | |
| fi | |
| if [ ! -s examples/minimal_interpreter_docker.csv ]; then | |
| echo "ERROR: CSV file is empty" | |
| exit 1 | |
| fi | |
| echo "SUCCESS: CSV file was created and is non-empty" | |
| echo "CSV file contents:" | |
| cat examples/minimal_interpreter_docker.csv | |
| publishJar: | |
| environment: deploy | |
| if: github.ref == 'refs/heads/deploy' | |
| runs-on: ubuntu-latest | |
| name: Publish Jar | |
| needs: [runEngineDockerSanity] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git clone https://github.com/SchmidtDSE/kigali-sim.git . | |
| git checkout ${{ github.sha }} | |
| - name: Setup Java | |
| run: | | |
| echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV | |
| echo "$JAVA_HOME_21_X64/bin" >> $GITHUB_PATH | |
| - name: Publish | |
| env: | |
| USERNAME: ${{ github.actor }} | |
| PUBLISH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: cd engine; ./gradlew publish | |
| continue-on-error: true # Allow jar reject on documentation-only deploys | |
| deployLambda: | |
| environment: awsdeploy | |
| if: github.ref == 'refs/heads/deploy' | |
| runs-on: ubuntu-latest | |
| name: Deploy Lambda | |
| needs: [runEngineDockerSanity] | |
| steps: | |
| - name: Download fatJar | |
| run: | | |
| curl -o kigalisim-fat.jar \ | |
| https://build.kigalisim.org/artifacts/${{ github.sha }}/fatJar/kigalisim-fat.jar | |
| - name: Deploy to Lambda | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} | |
| AWS_LAMBDA_NAME: mlf-community-cloud | |
| AWS_LAMBDA_REGION: us-east-2 | |
| run: | | |
| aws lambda update-function-code \ | |
| --function-name "$AWS_LAMBDA_NAME" \ | |
| --region "$AWS_LAMBDA_REGION" \ | |
| --zip-file "fileb://kigalisim-fat.jar" |