Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

GitHub is a well-known platform hosting thousands of source-code repositories.

Besides, it It also provides issue tracking and basic project management capabilities.

...

In a nutshell, workflows are automated processes described as YAML files, stored under .github/workflows.  These These are usually triggered by events (e.g. code-commit, pull-request) or can also be scheduled.

...

Each time a workflow is triggered, a workflow run is created; it contains a specific context.   Each job in the workflow uses a fresh virtual environment (e.g. ubuntu-latest) sharing the same virtual file system.

...

Environment variables can also be used to access some data and share them , with care. Environment variables are available at workflow, job or step level. GitHub fills out some environment variables by default.

...

To implement the continuous integration, we'll implement a specific workflow for it and store it .github/workflows/CI-jira-onpremises-example.yaml.

We’ll use the actions/checkout action to checkout the code from our repository to the virtual environment.   This action is one of the "standard" actions provided by GitHub (check full list here).

...

Code Block
languageyml
title.github/workflows/CI-jira-onpremises-example.yaml
name: CI (Jira on-premises example)
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
        
    steps:
    - uses: actions/checkout@v1
    - name: Set up Java
      uses: actions/setup-java@v1
      with:
        java-version: '1.8'
    - name: Cache Maven packages
      uses: actions/cache@v2
      with:
        path: ~/.m2
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2
    - name: Build with Maven
      run: mvn clean compile test --file java-junit-calc/pom.xml
    - name: Submit results to Xray
      env:
        JIRA_SERVER_URL: ${{ secrets.jira_server_url }}
        JIRA_USERNAME: ${{ secrets.jira_username }}
        JIRA_PASSWORD: ${{ secrets.jira_password }}
      run: 'curl -H "Content-Type: multipart/form-data" -u $jira$JIRA_userUSERNAME:$jira$JIRA_passwordPASSWORD -F "file=@target/surefire-reports/TEST-com.xpand.java.CalcTest.xml" "$jira$JIRA_serverSERVER_urlURL/rest/raven/1.0/import/execution/junit?projectKey=CALC"'


In order to submit those results to Xray, we'll just need to invoke the REST API (as detailed in Import Execution Results - REST).

...

To see the runs for your workflows (i.e. workflow runs), you may access the Actions tab in your repository browser.

...