-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (46 loc) · 1.78 KB
/
cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Java CI
on:
schedule:
- cron: '0 4 * * *'
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ '17.0.4+8' ]
steps:
- name: install git secrets
run: |
wget --no-verbose -O git-secrets-1.3.0.tar.gz https://github.com/awslabs/git-secrets/archive/1.3.0.tar.gz
tar -zxf git-secrets-1.3.0.tar.gz
cd git-secrets-1.3.0
sudo make install
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
# Step that does that actual cache save and restore
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Get latest snapshot version
run: echo 'LATEST_VERSION='$(curl "https://artifacts.oicr.on.ca/artifactory/api/search/latestVersion?g=io.dockstore&a=dockstore&repos=collab-snapshot&v=*") >> $GITHUB_ENV
- name: Build with mvnw
run: ./mvnw clean test -Punit-tests -Ddockstore-core.version=${{ env.LATEST_VERSION }} -B -ntp -U
- name: Check what changed
run: git diff
- name: Post to a Slack channel on failure
if: failure()
id: slack
uses: slackapi/[email protected]
with:
payload: "{\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"dockstore-cli/.github/workflows/cron.yml has failed!\"}}]}"
channel-id: 'CTWPH9Q03' # Slack channel id to post message
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK