Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add GH action to update dependencies #717

Merged
merged 3 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update dependencies
on:
schedule:
# Run automatically at 7AM PST Tuesday
- cron: '0 14 * * 2'
workflow_dispatch:

jobs:
update-dependencies-and-test:
name: Update Dependencies & Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
max-parallel: 1
matrix:
java: [ 8, 11 ]

steps:
- name: Checkout sendgrid-java
uses: actions/checkout@v2

- name: Updating semver dependencies
run: make update-deps

- name: Run Unit Tests
run: make test-docker version=${{ matrix.java }}

- name: Add & Commit
if: matrix.java == '11'
uses: EndBug/add-and-commit@v8.0.2
with:
add: 'pom.xml'
default_author: 'github_actions'
message: 'chore: update sendgrid-java dependencies'

notify-on-failure:
name: Slack notify on failure
if: failure()
needs: [ update-dependencies-and-test ]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: failure
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Update dependencies *{0}*, {1}/{2}/actions/runs/{3}', needs.update-dependencies-and-test.result, github.server_url, github.repository, github.run_id) }}
SLACK_TITLE: Action Failure - ${{ github.repository }}
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: install package test test-integ test-docker clean
.PHONY: install package test test-integ test-docker update-deps clean

VERSION := $(shell mvn help:evaluate -Dexpression=project.version --batch-mode | grep -e '^[^\[]')
install:
Expand All @@ -20,5 +20,8 @@ test-docker:
curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/HEAD/prism/prism-java.sh -o prism.sh
version=$(version) bash ./prism.sh

update-deps:
mvn versions:use-latest-releases versions:commit -DallowMajorUpdates=false

clean:
mvn clean