diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index c84b2ee..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,88 +0,0 @@ -# This is a sample .codeclimate.yml configured for Engine analysis on Code -# Climate Platform. For an overview of the Code Climate Platform, see here: -# http://docs.codeclimate.com/article/300-the-codeclimate-platform - -# Under the engines key, you can configure which engines will analyze your repo. -# Each key is an engine name. For each value, you need to specify enabled: true -# to enable the engine as well as any other engines-specific configuration. - -# For more details, see here: -# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform - -# For a list of all available engines, see here: -# http://docs.codeclimate.com/article/296-engines-available-engines - -#engines: -# to turn on an engine, add it here and set enabled to `true` -# to turn off an engine, set enabled to `false` or remove it -# rubocop: -# enabled: true -# golint: -# enabled: true -# gofmt: -# enabled: true -# eslint: -# enabled: true -# csslint: -# enabled: true - -# Engines can analyze files and report issues on them, but you can separately -# decide which files will receive ratings based on those issues. This is -# specified by path patterns under the ratings key. - -# For more details see here: -# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform - -# ratings: -# paths: -# - app/** -# - lib/** -# - "**.rb" -# - "**.go" - -# You can globally exclude files from being analyzed by any engine using the -# exclude_paths key. - -#All maintainability checks are enabled by default with the following configurations. -#checks, -# argument-count: -# config: -# threshold: 4 -# complex-logic: -# config: -# threshold: 4 -# file-lines: -# config: -# threshold: 250 -# method-complexity: -# config: -# threshold: 5 -# method-count: -# config: -# threshold: 20 -# method-lines: -# config: -# threshold: 25 -# nested-control-flow: -# config: -# threshold: 4 -# return-statements: -# config: -# threshold: 4 -# similar-code: -# config: -# threshold: # language-specific defaults. an override will affect all languages. -# identical-code: -# config: -# threshold: # language-specific defaults. an override will affect all languages. - -engines: - sonar-java: - enabled: true - channel: beta - -exclude_paths: -- "scripts/" -- ".github/" -- "gradle/" -- "**/test/" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d4317b9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Sonatype Maven + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: temurin + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + - name: Publish to Maven + env: + MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: mvn clean deploy -DskipTests=true -B -U -Prelease + + notify-on-failure: + name: Slack notify on failure + if: ${{ failure() }} + needs: [release] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} + SLACK_TITLE: Release Failure + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c985db3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,50 @@ +name: Tests +on: + push: + branches: [ '*' ] + pull_request: + branches: [ main ] + schedule: + # Run automatically at 8AM PST Monday-Friday + - cron: '0 15 * * 1-5' + workflow_dispatch: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + + - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + - name: Run Unit Tests + run: mvn test -B + + notify-on-failure: + name: Slack notify on failure + if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: ${{ needs.test.status }} + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} + SLACK_TITLE: Build Failure + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.maven.xml b/.maven.xml deleted file mode 100644 index bef1ab6..0000000 --- a/.maven.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - ossrh - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} - - - - - - ossrh - - true - - - ${env.GPG_EXECUTABLE} - ${env.GPG_PASSPHRASE} - - - - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3fa7c29..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: java -before_install: -- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import --batch || true -- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch || true -jdk: -- openjdk8 -- openjdk11 -install: -- mvn --settings .maven.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true - -B -V -after_success: -- bash <(curl -s https://codecov.io/bash) -t $CODECOV_KEY -deploy: -- provider: script - script: mvn clean deploy --settings .maven.xml -DskipTests=true -B -U -Prelease - skip_cleanup: true - on: - tags: true - jdk: openjdk8 - branch: main -notifications: - slack: - if: branch = main - on_pull_requests: false - on_success: never - on_failure: change - rooms: - secure: jnmSBE28sD/3ZFMDtnBtrxpB4h8aOPmqXJXv7rUQMUflf5+9slbaj8des72QpNAWOJnHjY0MasfKCuQlau9b5iPllJEF3aVswCORFErsLT3U5UW4qolC0MeTygj3g6RQUsrgFxuUxOrDW6OSkFV4gASyrFIqeI+pBj8Xu0YAdxnIJGTAKYQ+c8wLL4uiUgle3id0QRTv6BArezROjAlFpE7S40BCN/ulgVOT1X0gD3HtuXkSscnmnqmWY2UurbHQ3yPcR2xJo75tY6Hf4CxTJAqioVH8ygbboMMFYbzhlfZyGofbz01g5mUNRB6s39AnoxoOhkDJRJY6J3i+xhJBufLN8XxiFyq176ngZJDjCF/pjg5sWDdlmG8pHZawrBEecMOrg29CnuuBzNZpWz1+93cOD4Ak1UtZC5m04+X8oMUx1Q+pjRPdFJYSHXStBBYNV1/aNCNIOFVm6tAN+JgpO6I3aEKI2PMJaxeqUtU931pEzz/48DJYCHIsL7ZSDopPjenPck6UfhrwE4fubzwfac8JVnwTGKqENlVChPP7jMTb8tK2a2RpMel7PMrriTUm+RMoEFi8x2wntPm9CdqQ+bn8VsOppQ2IIOj85d4prcPxfTJMUsKAQh5WRHHT472WxH+OOOFYo6fZLEam+toTmW/zeK8+oCefVy+1SQR8hHk= diff --git a/README.md b/README.md index f7bee96..463f315 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![SendGrid Logo](twilio_sendgrid_logo.png) -[![Build Status](https://travis-ci.com/sendgrid/java-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/java-http-client) +[![BuildStatus](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.sendgrid/java-http-client.svg)](http://mvnrepository.com/artifact/com.sendgrid/java-http-client) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) diff --git a/src/test/java/com/sendgrid/TestRequiredFilesExist.java b/src/test/java/com/sendgrid/TestRequiredFilesExist.java index fa73126..792b209 100644 --- a/src/test/java/com/sendgrid/TestRequiredFilesExist.java +++ b/src/test/java/com/sendgrid/TestRequiredFilesExist.java @@ -29,15 +29,6 @@ public class TestRequiredFilesExist { assertTrue(new File("./.gitignore").exists()); } - // ./.travis.yml - @Test public void checkTravisExists() { - assertTrue(new File("./.travis.yml").exists()); - } - - // ./.codeclimate.yml - @Test public void checkCodeClimateExists() { - assertTrue(new File("./.codeclimate.yml").exists()); - } // ./CHANGELOG.md @Test public void checkChangelogExists() {