kopia lustrzana https://github.com/onthegomap/planetiler
Inline sonar token (#186)
rodzic
3332d27b16
commit
48c443135a
|
@ -28,7 +28,6 @@ jobs:
|
||||||
build:
|
build:
|
||||||
name: Java ${{ matrix.jdk }} / ${{ matrix.os }} ${{ matrix.args }}
|
name: Java ${{ matrix.jdk }} / ${{ matrix.os }} ${{ matrix.args }}
|
||||||
# Wait until after we check that you ran mvn spotless:apply, otherwise will fail with a cryptic error message
|
# Wait until after we check that you ran mvn spotless:apply, otherwise will fail with a cryptic error message
|
||||||
needs: lint
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -50,20 +49,19 @@ jobs:
|
||||||
java-version: ${{ matrix.jdk }}
|
java-version: ${{ matrix.jdk }}
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
|
# Skip spotless since that gets checked in a separate task
|
||||||
- name: Build with mvnw (linux/mac)
|
- name: Build with mvnw (linux/mac)
|
||||||
if: ${{ !contains(matrix.os, 'windows') }}
|
if: ${{ !contains(matrix.os, 'windows') }}
|
||||||
run: ./mvnw ${{matrix.args}} --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
|
run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
|
||||||
- name: Build with mvnw.cmd (windows)
|
- name: Build with mvnw.cmd (windows)
|
||||||
if: ${{ contains(matrix.os, 'windows') }}
|
if: ${{ contains(matrix.os, 'windows') }}
|
||||||
run: mvnw.cmd ${{matrix.args}} --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
|
run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
regenerate:
|
regenerate:
|
||||||
name: Regenerate
|
name: Regenerate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
# Wait until after we check that you ran mvn spotless:apply, otherwise will fail with a cryptic error message
|
|
||||||
needs: lint
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
|
@ -73,8 +71,9 @@ jobs:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
- run: ./scripts/regenerate-openmaptiles.sh
|
- run: ./scripts/regenerate-openmaptiles.sh
|
||||||
- run: ./mvnw -DskipTests --batch-mode -no-transfer-progress clean install -pl planetiler-basemap -am
|
# Skip spotless since that gets checked in a separate task
|
||||||
- run: ./mvnw --batch-mode -no-transfer-progress verify -pl planetiler-basemap
|
- run: ./mvnw -Dspotless.check.skip -DskipTests --batch-mode -no-transfer-progress clean install -pl planetiler-basemap -am
|
||||||
|
- run: ./mvnw -Dspotless.check.skip --batch-mode -no-transfer-progress verify -pl planetiler-basemap
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
name: Example project
|
name: Example project
|
||||||
|
|
|
@ -33,12 +33,12 @@ jobs:
|
||||||
restore-keys: ${{ runner.os }}-sonar
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
- name: Analyze with SonarCloud
|
- name: Analyze with SonarCloud
|
||||||
run: |
|
run: |
|
||||||
mvn -Dspotless.apply.skip -Pcoverage -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
mvn -Dspotless.check.skip -Pcoverage -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
|
||||||
env:
|
env:
|
||||||
# Needed to get some information about the pull request, if any
|
# Needed to get some information about the pull request, if any
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
|
# Read-only user, use this token to link SonarLint to SonarCloud as well
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: c2cfe8bd7368ced07e84a620b7c2487846e220eb
|
||||||
- name: Wait for SonarCloud API to update...
|
- name: Wait for SonarCloud API to update...
|
||||||
run: "sleep 10"
|
run: "sleep 10"
|
||||||
- name: Upload annotations on PRs
|
- name: Upload annotations on PRs
|
||||||
|
|
|
@ -35,8 +35,6 @@ easier though.
|
||||||
- [Install IntelliJ IDEA](https://www.jetbrains.com/help/idea/installation-guide.html)
|
- [Install IntelliJ IDEA](https://www.jetbrains.com/help/idea/installation-guide.html)
|
||||||
- Install
|
- Install
|
||||||
the [Adapter for Eclipse Code Formatter plugin](https://plugins.jetbrains.com/plugin/6546-adapter-for-eclipse-code-formatter)
|
the [Adapter for Eclipse Code Formatter plugin](https://plugins.jetbrains.com/plugin/6546-adapter-for-eclipse-code-formatter)
|
||||||
- Install the [SonarLint plugin](https://plugins.jetbrains.com/plugin/7973-sonarlint) (recommended) to see static
|
|
||||||
analysis results while editing code.
|
|
||||||
- In IntelliJ, click `Open`, navigate to the the `pom.xml` file in the local copy of this repo, and `Open`
|
- In IntelliJ, click `Open`, navigate to the the `pom.xml` file in the local copy of this repo, and `Open`
|
||||||
then `Open as Project`
|
then `Open as Project`
|
||||||
- If IntelliJ asks (and you trust the code) then click `Trust Project`
|
- If IntelliJ asks (and you trust the code) then click `Trust Project`
|
||||||
|
@ -55,8 +53,6 @@ Troubleshooting:
|
||||||
### Visual Studio Code
|
### Visual Studio Code
|
||||||
|
|
||||||
- Install the [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
|
- Install the [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
|
||||||
- Install the [SonarLint plugin](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarlint-vscode)
|
|
||||||
(recommended) to see static analysis results while editing code.
|
|
||||||
- In VSCode, click `File -> Open` and navigate to Planetiler directory
|
- In VSCode, click `File -> Open` and navigate to Planetiler directory
|
||||||
- If VSCode asks (and you trust the code) then click `Yes I trust the authors`
|
- If VSCode asks (and you trust the code) then click `Yes I trust the authors`
|
||||||
- To verify everything works correctly, go to the `Testing` tab and click `Run Tests`
|
- To verify everything works correctly, go to the `Testing` tab and click `Run Tests`
|
||||||
|
@ -67,8 +63,6 @@ Learn more about using VSCode with Java [here](https://code.visualstudio.com/doc
|
||||||
|
|
||||||
- In [Eclipse for Java Developers](https://www.eclipse.org/downloads/packages/), click `File -> Import ...`
|
- In [Eclipse for Java Developers](https://www.eclipse.org/downloads/packages/), click `File -> Import ...`
|
||||||
then `Maven -> Existing Maven Projects`, navigate to Planetiler directory, and click `Finish`
|
then `Maven -> Existing Maven Projects`, navigate to Planetiler directory, and click `Finish`
|
||||||
- Install the [SonarLint plugin](https://marketplace.eclipse.org/content/sonarlint)
|
|
||||||
(recommended) to see static analysis results while editing code.
|
|
||||||
- Under `Eclipse -> Preferences...`:
|
- Under `Eclipse -> Preferences...`:
|
||||||
- Under `Java -> Code Style -> Formatter` and choose `Import...`
|
- Under `Java -> Code Style -> Formatter` and choose `Import...`
|
||||||
choose [`eclipse-formatter.xml`](eclipse-formatter.xml) from the root of this project. Then choose `Planetiler` as
|
choose [`eclipse-formatter.xml`](eclipse-formatter.xml) from the root of this project. Then choose `Planetiler` as
|
||||||
|
@ -82,3 +76,13 @@ Learn more about using VSCode with Java [here](https://code.visualstudio.com/doc
|
||||||
- To verify everything works correctly, right click on `planetiler-core/src/test/java` folder and
|
- To verify everything works correctly, right click on `planetiler-core/src/test/java` folder and
|
||||||
click `Run As -> JUnit Test`
|
click `Run As -> JUnit Test`
|
||||||
|
|
||||||
|
## SonarLint Plugin Setup (optional, but recommended)
|
||||||
|
|
||||||
|
Planetiler uses [SonarCloud](https://sonarcloud.io/project/overview?id=onthegomap_planetiler) to statically analyze pull
|
||||||
|
requests to catch common bugs and security vulnerabilities. To preview Sonar warnings in VS Code, IntelliJ, or Eclipse:
|
||||||
|
|
||||||
|
- Follow the directions on [sonarlint.org](https://www.sonarlint.org/) to install the plugin for your IDE
|
||||||
|
- Then to synchronize your local configuration with the one used in SonarCloud,
|
||||||
|
enable [Connected Mode](https://www.sonarlint.org/bring-your-team-on-board) for your IDE using "SonarCloud"
|
||||||
|
connection type and the shared read-only API token used in GitHub CI: `c2cfe8bd7368ced07e84a620b7c2487846e220eb`
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue