Merge pull request #7 from fga-eps-mds/docs/update_readme #16
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: Build for Sonar | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
#2 Setup Java | |
- name: Set Up Java | |
uses: actions/[email protected] | |
with: | |
distribution: 'oracle' | |
java-version: '17' | |
#3 Setup Flutter | |
- name: Set Up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.24.3' | |
channel: 'stable' | |
#4 Install Dependencies | |
- name: Install Dependencies | |
run: flutter pub get | |
#5 Run flutter tests | |
- name: Run Flutter Tests | |
run: flutter test --coverage | |
#6 Run Sonar cloud scan | |
- name: SonarCloud Scan | |
env: | |
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
export SONAR_SCANNER_VERSION=6.2.1.4610 | |
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64 | |
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip | |
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ | |
export PATH=$SONAR_SCANNER_HOME/bin:$PATH | |
export SONAR_SCANNER_OPTS="-server" | |
sonar-scanner \ | |
-Dsonar.organization=fga-eps-mds-1 \ | |
-Dsonar.projectKey=fga-eps-mds_2024.2-ARANDU-APP\ | |
-Dsonar.sources=./lib \ | |
-Dsonar.host.url=https://sonarcloud.io |