Skip to content

Build Pipeline

Nicolas Boltz edited this page Aug 1, 2024 · 6 revisions

Palladio-Build-Actions Pipeline

We are using GitHub Actions to build and deploy our projects. The actions are made up of one parent action, the Palladio-Build-ActionsPipeline, which defines pipeline steps for the build.

For deployment, there exists an additional action, the Palladio-Build-ActionsPipeline-Deployment.

The ActionsPipeline calls the ActionsPipeline-Deployment action to deploy the created artifacts to our updatesite.

Pipeline Stages

  • Set up job: Sets some GitHub specific information
  • Build PalladioSimulator/Palladio-Build-ActionsPipeline-Deployment@...: Builds the action used for deployment. This is done using docker
  • Checkout Repository: Does what the name suggests
  • Set up JDK: Installs the specified version of java
  • Verify with Maven: Calls mvn clean verify
  • Check Deployment: Checks if the build was triggered by a push on the main branch (or nightly build). If not the following jobs are skipped.
    • Create folder name: Creates the folder name from the repository naming
    • Create project deployment path: Builds the first part of the path for deployment (path on server and repository name)
    • Create Deployment path: Builds the full path, where the build artifacts are going to be deployed (adds either nightly, release or branch folder structure)
    • Deploy to Updatesite: Calls Palladio-Build-ActionsPipeline-Deployment. This uses SCP and SFTP to deploy the files to the server.
    • Post and Cleanup Stages

How to integrate your project

Our nightly contains an auto-update script that scans the organization for repositories once a week. If you want to integrate your project into our nightly build process, your repository should build without errors using mvn clean verify and include the GitHub actions script named build.yml described below.

To include your project in our nightly build process using our GitHub actions pipeline and deploy it to our update site, you need to add the following .yml file to the .github/workflows/build.yml directory in your project:

name: Build Pipeline

on: [push, pull_request, workflow_dispatch]

jobs:
  <name of your repository>:
    uses: PalladioSimulator/Palladio-Build-ActionsPipeline/.github/workflows/build.yml@<latest version>
    with:
      use-display-output: true
      no-caching: true
      deploy-updatesite: 'releng/org.palladiosimulator.protocom.updatesite/target/repository'
    secrets:
      SERVER_SSH_KEY: ${{ secrets.DEPLOYMENT_SERVER_SSH_KEY }}
      REMOTE_HOST: ${{ secrets.DEPLOYMENT_REMOTE_HOST }}
      REMOTE_PORT: ${{ secrets.DEPLOYMENT_REMOTE_PORT }}
      REMOTE_USER: ${{ secrets.DEPLOYMENT_REMOTE_USER }}
      REMOTE_TARGET: ${{ secrets.DEPLOYMENT_REMOTE_TARGET }}