Update chaiyong.yml #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI with SonarCloud | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: ${{ env.PR_FETCH_DEPTH }} | |
- name: Set up JDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' # You can change this to the version you want | |
- name: Compile Java | |
run: | | |
cd instructors/exercise | |
javac -d . *.java | |
# Compile java file from directory | |
sonarcloud: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: ${{ env.PR_FETCH_DEPTH }} | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
projectBaseDir: instructors/exercise | |
# sonarPropertiesPath: instructors/exercise | |
# - name: Execute Java | |
# run: java -cp . MainClass # Replace MainClass with your main class name |