DEV Community

Cover image for Execute all JMeter files with GitHUB Actions
Boga Sebastian Nicolae
Boga Sebastian Nicolae

Posted on

Execute all JMeter files with GitHUB Actions

I created a github workflow to be able to run all jmx files from my repository.

Image description

The workflow is triggered on push [main]. The machine provided by github is an ubuntu machine. Once we have the machine up and running with the operating system:

My Workflow

  1. checkout actions/checkout@v2
  2. displays the current folder (you can refer to this folder like this $GITHUB_WORKSPACE)
  3. install the JMeter version 5.4.1 (here we also display the jmeter version and also the current folder location)
  4. install the plugins for JMeter(here we just install the Dummy Sampler, but you can add any other plugin needed by your jmeter script; you can see all the available plugins here:
  5. run each jmx file from the repo

Submission Category:

Maintainer Must-Haves
DIY Deployments

Yaml File or Link to Code

GitHub logo sebiboga / jmeter_one

JMeter scripts


  • different JMeter scripts
  • GitHUB Actions used to define the workflow to run all jmeter scripts from repository [main branch]

# This is a workflow to help you run all JMeter scripts with Actions

name: jmeter

# Controls when the workflow will run
  # Triggers the workflow on push or pull request events but only for the main branch
    branches: [ main ]

  # Allows you to run this workflow manually from the Actions tab

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
  # This workflow contains a single job called "build"
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      - name: where are the files?
        run: |

      # Runs a set of commands using the runners shell
      - name: install jmeter
        run: |
          java -version
          cd apache-jmeter-5.4.1/bin
          ./jmeter -v

      - name: install plugins
        run: |
          cd $GITHUB_WORKSPACE/apache-jmeter-5.4.1
          wget -q --no-check-certificate  -P .
          unzip -o  && rm

      - name: run jmx scripts
        run: |
         cd $GITHUB_WORKSPACE/apache-jmeter-5.4.1/bin
         for i in $( ls $GITHUB_WORKSPACE/*.jmx); do
            ./jmeter -n -t $i;
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

For now we do not keep the artifacts, but for sure in next version I'll add another step in the workflow so we can have also the artifacts generated by JMeter.

Discussion (0)