Skip to content

Commit

Permalink
New package. Add Dependabot, Codacy and Sonatype. Update README.
Browse files Browse the repository at this point in the history
* Add Dependabot, Codacy and Sonatype. Update README.

* Move to new package io.github.vitalijr2
  • Loading branch information
vitalijr2 authored Feb 18, 2024
1 parent 48cb246 commit 14f9fb6
Show file tree
Hide file tree
Showing 33 changed files with 173 additions and 35 deletions.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for Maven
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
target-branch: "development"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
day: "sunday"
target-branch: "development"
73 changes: 73 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Codacy"

on:
push:
branches: [ "**" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "**" ]

jobs:
build:
name: Maven build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 11
- name: Build with Maven
run: ./mvnw --batch-mode
- name: Temporarily save target and test requests
uses: actions/upload-artifact@master
with:
name: tests-and-target
path: |
core/target
logger/target
json-logger/target
retention-days: 1
codacy-security-scan:
name: Codacy Security Scan
needs: build
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
gh-code-scanning-compat: true
max-allowed-issues: 2147483647
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
codacy-coverage-reporter:
name: Codacy Coverage Reporter
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Retrieve saved test requests and target
uses: actions/download-artifact@master
with:
name: tests-and-target
path: .
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: core/target/site/jacoco/jacoco.xml,logger/target/site/jacoco/jacoco.xml,json-logger/target/site/jacoco/jacoco.xml
29 changes: 29 additions & 0 deletions .github/workflows/sonatype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Publish artifacts"

on:
release:
types: [ created ]

jobs:
publish:
name: Publish to Maven Central
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 11
- name: Build and publish with Maven
env:
SIGN_KEY: ${{ secrets.SIGN_KEY }}
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}
SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USERNAME }}
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
run: ./mvnw --batch-mode -s .mvn/ci_settings.xml -pl core,logger,json-logger,. -am -ntp -DskipTests -Prelease
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import java.io.ObjectStreamException;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
package uk.bot_by.aws_lambda.slf4j;
/*
* Copyright 2022-2024 Vitalij Berdinskih
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.vitalijr2.aws.lambda.slf4j;

/**
* The configuration properties and environment variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import org.slf4j.ILoggerFactory;
import org.slf4j.IMarkerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* @author Vitalij Berdinskih
* @since 1.0.0
*/
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
uk.bot_by.aws_lambda.slf4j.AWSLambdaServiceProvider
io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaServiceProvider
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.nonNull;
import static org.junit.jupiter.api.Assertions.assertAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.isNull;
import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -8,14 +8,14 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerLevel.Builder;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.converter.ConvertWith;
import org.junit.jupiter.params.converter.TypedArgumentConverter;
import org.junit.jupiter.params.provider.CsvSource;
import org.slf4j.event.Level;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerLevel.Builder;

@Tag("fast")
class AWSLambdaLoggerLevelTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.nonNull;
import static org.junit.jupiter.api.Assertions.assertAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static java.util.Objects.nonNull;
import static org.junit.jupiter.api.Assertions.assertAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j;
package io.github.vitalijr2.aws.lambda.slf4j;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/org/example/ServiceProvider.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.example;

import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerOutput;
import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerOutput;

public interface ServiceProvider extends AWSLambdaLoggerOutput {

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/org/example/TestServiceProvider.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.example;

import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Marker;
import org.slf4j.event.Level;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerConfiguration;

public class TestServiceProvider implements ServiceProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j.json_output;
package io.github.vitalijr2.aws.lambda.slf4j.logger;

import static java.util.Objects.nonNull;

import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.amazonaws.services.lambda.runtime.LambdaRuntime;
import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerConfiguration;
import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerOutput;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.text.DateFormat;
Expand All @@ -31,8 +33,6 @@
import org.slf4j.MDC;
import org.slf4j.Marker;
import org.slf4j.event.Level;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerConfiguration;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerOutput;

/**
* An SLF4J Logger implementation for AWS Lambda with JSON output.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* @author Vitalij Berdinskih
* @since 1.0.0
*/
package uk.bot_by.aws_lambda.slf4j.json_output;
package io.github.vitalijr2.aws.lambda.slf4j.logger;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.github.vitalijr2.aws.lambda.slf4j.logger.JSONLoggerOutput

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.bot_by.aws_lambda.slf4j.json_output;
package io.github.vitalijr2.aws.lambda.slf4j.logger;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
Expand All @@ -19,6 +19,7 @@
import static org.skyscreamer.jsonassert.JSONAssert.assertEquals;

import com.amazonaws.services.lambda.runtime.LambdaLogger;
import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerConfiguration;
import java.io.PrintStream;
import java.text.DateFormat;
import java.text.FieldPosition;
Expand All @@ -38,7 +39,6 @@
import org.slf4j.Marker;
import org.slf4j.event.Level;
import org.slf4j.helpers.BasicMarkerFactory;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerConfiguration;

@ExtendWith(MockitoExtension.class)
@Tag("fast")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.bot_by.aws_lambda.slf4j.lambda_logger;
package io.github.vitalijr2.aws.lambda.slf4j.logger;

import static java.util.Objects.nonNull;

import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.amazonaws.services.lambda.runtime.LambdaRuntime;
import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerConfiguration;
import io.github.vitalijr2.aws.lambda.slf4j.AWSLambdaLoggerOutput;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.text.DateFormat;
Expand All @@ -29,8 +31,6 @@
import org.slf4j.MDC;
import org.slf4j.Marker;
import org.slf4j.event.Level;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerConfiguration;
import uk.bot_by.aws_lambda.slf4j.AWSLambdaLoggerOutput;

/**
* An SLF4J Logger implementation for AWS Lambda.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.github.vitalijr2.aws.lambda.slf4j.logger.LambdaLoggerOutput

This file was deleted.

Loading

0 comments on commit 14f9fb6

Please sign in to comment.