-
Notifications
You must be signed in to change notification settings - Fork 16
38 lines (34 loc) · 1.21 KB
/
ant-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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 }}