Skip to content

Commit

Permalink
#3: CI build (#4)
Browse files Browse the repository at this point in the history
* #3: Added CI build

Co-authored-by: Christoph Pirkl <[email protected]>
  • Loading branch information
redcatbear and kaklakariada authored Sep 13, 2022
1 parent d9f75fc commit 7ff2487
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 14 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/broken_links_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Broken Links Checker

on:
schedule:
- cron: "0 5 * * 0"
push:
branches:
- main
pull_request:

jobs:
linkChecker:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Configure broken links checker
run: |
mkdir -p ./target
echo '{ "aliveStatusCodes": [429, 200], "ignorePatterns": [{"pattern": "^https?://(www.)?opensource.org"}] }' > ./target/broken_links_checker.json
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: ./target/broken_links_checker.json
52 changes: 52 additions & 0 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Java CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Cache SonarQube packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- uses: gradle/wrapper-validation-action@v1

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'

- name: Build with Gradle
run: ./gradlew clean build --info --warning-mode all

- name: Publish Test Report
uses: scacap/action-surefire-report@v1
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
with:
report_paths: '**/build/test-results/*/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Sonar analysis
if: ${{ env.SONAR_TOKEN != null }}
run: |
./gradlew sonarqube -Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=kaklakariada-github \
-Dsonar.login=$SONAR_TOKEN \
--info --warning-mode=summary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
[![Build Status](https://github.com/itsallcode/openfasttrrace-intellij-pluginactions/workflows/ci-build.yml/badge.svg)](https://github.com/itsallcode/openfasttrrace-intellij-pluginactions/workflows/ci-build.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=security_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=sqale_index)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=security_rating)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=sqale_index)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=code_smells)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=coverage)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Aexasol-virtual-schema-lua&metric=ncloc)](https://sonarcloud.io/dashboard?id=com.exasol%3Aexasol-virtual-schema-lua)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=code_smells)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=coverage)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aopenfasttrace-intellij-plugin&metric=ncloc)](https://sonarcloud.io/dashboard?id=org.itsallcode%3Aopenfasttrace-intellij-plugin)
-->

![OFT Logo](doc/images/openfasttrace_logo.svg)
Expand All @@ -31,14 +31,12 @@ Editor support for writing and maintaining OpenFastTrace documents

### Information for Users

* [User Guide](doc/user_guide/user_guide.md)
* [Changelog](doc/changes/changelog.md)

### Information for Contributors

Requirement, design documents and coverage tags are written in [OpenFastTrace](https://github.com/itsallcode/openfasttrace) format.

* [Developer Guide](doc/developer_guide/developer_guide.md)
* [Getting Started With IntelliJ Plugin Development](doc/developer_guide/getting_started_intellij_plugin_development.md)

### Runtime Dependencies
Expand Down
19 changes: 18 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id("java")
id("org.jetbrains.intellij") version "1.8.0"
id("jacoco")
id("org.jetbrains.intellij") version "1.9.0"
id("org.sonarqube") version "3.4.0.2513"
}

group = "org.itsallcode"
Expand Down Expand Up @@ -41,3 +43,18 @@ tasks {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}

tasks.test {
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
}
}

tasks.sonarqube {
dependsOn(tasks.jacocoTestReport)
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.itsallcode.intellij.oftplugin;
package org.itsallcode.openfasttrace.intellijplugin;

import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.actionSystem.AnAction;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<actions>
<action
id="Oft.ShowUserGuide.HelpMenu"
class="org.itsallcode.intellij.oftplugin.ShowUserGuideAction"
class="org.itsallcode.openfasttrace.intellijplugin.ShowUserGuideAction"
text="OpenFastTrace User Guide"
description="Open the OpenFastTrace user Guide in the built-in browser."
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.itallcode.openfasttrace.intelijplugin;

import org.junit.Test;

public class MockTest {
// This is a test that only exists to have a single test result in the test report. It is required to find out if
// the CI build works. It will be removed with a later PR once real tests exist.
@Test
public void testNothing(){
// empty on purpose.
}
}

0 comments on commit 7ff2487

Please sign in to comment.