Skip to content

Commit 1ca4a08

Browse files
authored
feat: add GH action to update dependencies (#717)
1 parent 780ca3d commit 1ca4a08

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Update dependencies
2+
on:
3+
schedule:
4+
# Run automatically at 7AM PST Tuesday
5+
- cron: '0 14 * * 2'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-dependencies-and-test:
10+
name: Update Dependencies & Test
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 20
13+
strategy:
14+
max-parallel: 1
15+
matrix:
16+
java: [ 8, 11 ]
17+
18+
steps:
19+
- name: Checkout sendgrid-java
20+
uses: actions/checkout@v2
21+
22+
- name: Updating semver dependencies
23+
run: make update-deps
24+
25+
- name: Run Unit Tests
26+
run: make test-docker version=${{ matrix.java }}
27+
28+
- name: Add & Commit
29+
if: matrix.java == '11'
30+
uses: EndBug/add-and-commit@v8.0.2
31+
with:
32+
add: 'pom.xml'
33+
default_author: 'github_actions'
34+
message: 'chore: update sendgrid-java dependencies'
35+
36+
notify-on-failure:
37+
name: Slack notify on failure
38+
if: failure()
39+
needs: [ update-dependencies-and-test ]
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: rtCamp/action-slack-notify@v2
43+
env:
44+
SLACK_COLOR: failure
45+
SLACK_ICON_EMOJI: ':github:'
46+
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) }}
47+
SLACK_TITLE: Action Failure - ${{ github.repository }}
48+
SLACK_USERNAME: GitHub Actions
49+
SLACK_MSG_AUTHOR: twilio-dx
50+
SLACK_FOOTER: Posted automatically using GitHub Actions
51+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
52+
MSG_MINIMAL: true

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install package test test-integ test-docker clean
1+
.PHONY: install package test test-integ test-docker update-deps clean
22

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

23+
update-deps:
24+
mvn versions:use-latest-releases versions:commit -DallowMajorUpdates=false
25+
2326
clean:
2427
mvn clean

0 commit comments

Comments
 (0)