Skip to content

Update to GitHub actions #42

Update to GitHub actions

Update to GitHub actions #42

Workflow file for this run

# This workflow will build a Java project with Ant
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant
# Compiles, tests and generates reports using SonarCloud.
# This script is only called on push events (not pull requests).
# There is a separate and slightly different script for pull requets.
name: Build
on:
push:
branches: [ master ]
jobs:
build:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Remove 'pom.xml' otherwise Sonar will fail forcing to use Maven
- name: Remove pom.xml
run: rm -f pom.xml
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Ant
run: ant -noinput -buildfile build.xml
- name: Test with JUnit
run: ant -noinput -buildfile build.xml test
- name: Test with JUnit
run: ant -noinput -buildfile build.xml report
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}