diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml new file mode 100644 index 0000000..03be1d5 --- /dev/null +++ b/.github/workflows/pr-checks.yaml @@ -0,0 +1,47 @@ +name: PR checks + +on: + pull_request: + branches: + - main + - v12 + +permissions: + contents: read + +jobs: + backend-test: + name: Backend tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Test + run: ./gradlew :backend:plugin:test + + frontend-lint: + name: Frontend lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm install + working-directory: frontend + + - name: Lint + run: npm run lint + working-directory: frontend diff --git a/.github/workflows/publish-backend.yaml b/.github/workflows/publish-backend.yaml index 1cfc348..9325afd 100644 --- a/.github/workflows/publish-backend.yaml +++ b/.github/workflows/publish-backend.yaml @@ -79,18 +79,9 @@ jobs: env: CHANGED_DIR: ${{ matrix.value }} - - id: gradleIntegrationTestTaskAlize - name: Construct Gradle integration test task name from matrix variant - run: CHANGED_DIR=${{ matrix.value }}; echo "TASK_NAME=$(echo :$CHANGED_DIR:integrationTesting | sed -e 's/\//:/g')">>${GITHUB_OUTPUT} - env: - CHANGED_DIR: ${{ matrix.value }} - - name: Test run: ./gradlew ${{ steps.gradleTestTaskAlize.outputs.TASK_NAME }} - - name: Integration Test - run: ./gradlew ${{ steps.gradleIntegrationTestTaskAlize.outputs.TASK_NAME }} - - name: Publish run: ./gradlew ${{ steps.gradleTaskAlize.outputs.TASK_NAME }} env: diff --git a/backend/plugin/build.gradle.kts b/backend/plugin/build.gradle.kts index fbd9ef2..2630bf9 100644 --- a/backend/plugin/build.gradle.kts +++ b/backend/plugin/build.gradle.kts @@ -19,9 +19,9 @@ val mockitoKotlinVersion: String by project dockerCompose { setProjectName("value-mapper") - isRequiredBy(project.tasks.integrationTesting) + isRequiredBy(project.tasks.test) - tasks.integrationTesting { + tasks.test { useComposeFiles.addAll("$rootDir/docker-resources/docker-compose-base-test.yml") } } diff --git a/build.gradle.kts b/build.gradle.kts index c2361e2..a3be47a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -96,12 +96,6 @@ subprojects { } } - tasks.test { - useJUnitPlatform { - excludeTags("integration") - } - } - tasks.getByName("bootJar") { enabled = false } diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json new file mode 100644 index 0000000..3277e8e --- /dev/null +++ b/frontend/.eslintrc.json @@ -0,0 +1,32 @@ +{ + "root": true, + "ignorePatterns": ["projects/**/*", "dist/**/*", "node_modules/**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@angular-eslint/recommended", + "plugin:@angular-eslint/template/process-inline-templates" + ], + "rules": { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/no-wrapper-object-types": "off", + "@angular-eslint/no-empty-lifecycle-method": "off", + "@angular-eslint/prefer-standalone": "off", + "no-empty": "warn" + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@angular-eslint/template/recommended"], + "rules": { + "@angular-eslint/template/eqeqeq": "warn", + "@angular-eslint/template/no-negated-async": "warn" + } + } + ] +} diff --git a/frontend/angular.json b/frontend/angular.json index 16814b3..7c40f62 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -132,18 +132,6 @@ "src/assets" ] } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } } } }, diff --git a/frontend/projects/plugin/.eslintrc.json b/frontend/projects/plugin/.eslintrc.json index 3db9720..f2a95f9 100644 --- a/frontend/projects/plugin/.eslintrc.json +++ b/frontend/projects/plugin/.eslintrc.json @@ -1,21 +1,31 @@ { - "extends": "../../../.eslintrc.json", - "rules": { - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "valtimo", - "style": "kebab-case" - } - ], - "@angular-eslint/directive-selector": [ - "error", - { - "type": "directive", - "prefix": "valtimo", - "style": "camelCase" - } + "extends": "../../.eslintrc.json", + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/component-selector": [ + "warn", + { + "type": "element", + "prefix": "valtimo", + "style": "kebab-case" + } + ], + "@angular-eslint/directive-selector": [ + "warn", + { + "type": "directive", + "prefix": "valtimo", + "style": "camelCase" + } + ] + } + }, + { + "files": ["*.html"], + "rules": {} + } ] - } } diff --git a/gradle/test.gradle.kts b/gradle/test.gradle.kts index 62823d1..d3691fb 100644 --- a/gradle/test.gradle.kts +++ b/gradle/test.gradle.kts @@ -14,14 +14,9 @@ * limitations under the License. */ -tasks.register("integrationTesting") { - description = "Integration tests" - group = "verification" +tasks.named("test") { systemProperty("spring.profiles.include", "inttest,postgresql") - useJUnitPlatform { - includeTags("integration") - } - mustRunAfter("check") + useJUnitPlatform() doLast { "composeDownForced" }