Skip to content

Add rules to avoid commit and rollback #57

Add rules to avoid commit and rollback

Add rules to avoid commit and rollback #57

Workflow file for this run

name: Sonar ESQL build
on:
push:
branches:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-RC[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Update maven version
if: startsWith(github.ref, 'refs/tags/')
run: mvn versions:set -DnewVersion=${{ github.ref_name }} && mvn versions:commit
- name: Build with Maven
run: mvn -B clean org.jacoco:jacoco-maven-plugin:prepare-agent verify -P coverage-per-test
- name: SonarCloud Scan
run: mvn -B sonar:sonar -Dsonar.projectKey=EXXETA_sonar-esql-plugin -Dsonar.organization=exxeta -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Create Release candidate
id: create_release_candidate
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: true
prerelease: ${{contains(github.ref,'-RC')}}
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release_candidate.outputs.upload_url }}
asset_path: ./esql-plugin/target/esql-plugin-${{ github.ref_name }}.jar
asset_name: esql-plugin-${{ github.ref_name }}.jar
asset_content_type: application/java-archive
- name: Upload Codecoverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}