Skip to content

Commit ad8b8ae

Browse files
committed
feat: add GH action to update dependencies
1 parent a1d0c6e commit ad8b8ae

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Update dependencies
2+
on:
3+
schedule:
4+
# Run automatically at 6AM PST Tuesday
5+
- cron: '0 6 * * 2'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update_dependencies:
10+
name: Update Dependencies
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout java-http-client
14+
uses: actions/checkout@v2
15+
16+
- name: Updating semver dependencies
17+
run: make update-deps
18+
19+
- name: Add & Commit
20+
uses: EndBug/[email protected]
21+
with:
22+
add: 'pom.xml'
23+
default_author: 'github_actions'
24+
message: 'Chore: update sendgrid-java dependencies'
25+
26+
test:
27+
name: Test
28+
if: success()
29+
needs: [ update_dependencies ]
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 20
32+
strategy:
33+
matrix:
34+
java: [ 8, 11, 17 ]
35+
36+
steps:
37+
- name: Checkout java-http-client
38+
uses: actions/checkout@v2
39+
40+
- name: Set up Java
41+
uses: actions/setup-java@v2
42+
with:
43+
distribution: 'temurin'
44+
java-version: ${{ matrix.java }}
45+
cache: 'maven'
46+
47+
- run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
48+
- name: Run Unit Tests
49+
run: mvn test -B
50+
51+
notify-on-failure:
52+
name: Slack notify on failure
53+
if: failure()
54+
needs: [ update_dependencies, test ]
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: rtCamp/action-slack-notify@v2
58+
env:
59+
SLACK_COLOR: failure
60+
SLACK_ICON_EMOJI: ':github:'
61+
SLACK_MESSAGE: ${{ format('Update dependencies *{0}*, Test *{1}*, {2}/{3}/actions/runs/{4}', needs.update_dependencies.result, needs.tests.result, github.server_url, github.repository, github.run_id) }}
62+
SLACK_TITLE: Action Failure - ${{ github.repository }}
63+
SLACK_USERNAME: GitHub Actions
64+
SLACK_MSG_AUTHOR: twilio-dx
65+
SLACK_FOOTER: Posted automatically using GitHub Actions
66+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
67+
MSG_MINIMAL: true

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install package test test-integration clean
1+
.PHONY: install package test update-deps test-integration clean
22

33
VERSION := $(shell mvn help:evaluate -Dexpression=project.version --batch-mode | grep -e '^[^\[]')
44
install:
@@ -13,5 +13,8 @@ package:
1313
test:
1414
mvn test
1515

16+
update-deps:
17+
mvn versions:use-latest-releases versions:commit -DallowMajorUpdates=false
18+
1619
clean:
1720
mvn clean

0 commit comments

Comments
 (0)