-
Notifications
You must be signed in to change notification settings - Fork 4
151 lines (141 loc) · 4.55 KB
/
build.yml
File metadata and controls
151 lines (141 loc) · 4.55 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Build & test
on:
push:
branches: [ develop ]
tags:
- v*
pull_request:
branches: [ develop ]
workflow_dispatch:
repository_dispatch:
types: [utPLSQL-build]
defaults:
run:
shell: bash
jobs:
build:
name: Test on JDK ${{ matrix.jdk }} with utPLSQL ${{ matrix.utplsql_version }}
runs-on: ubuntu-latest
env:
ORACLE_VERSION: "gvenzl/oracle-xe:18.4.0-slim"
UTPLSQL_VERSION: ${{matrix.utplsql_version}}
UTPLSQL_FILE: ${{matrix.utplsql_file}}
ORACLE_PASSWORD: oracle
DB_URL: "127.0.0.1:1521:XE"
DB_USER: app
DB_PASS: app
strategy:
fail-fast: false
matrix:
utplsql_version: ["v3.0.1","v3.0.2","v3.0.3","v3.0.4","v3.1.1","v3.1.2","v3.1.3","v3.1.6","v3.1.7","v3.1.8","v3.1.9","v3.1.10","v3.1.11","develop"]
utplsql_file: ["utPLSQL"]
jdk: ['8']
include:
- utplsql_version: "v3.0.0"
jdk: '8'
utplsql_file: "utPLSQLv3.0.0"
- utplsql_version: "develop"
jdk: '9'
utplsql_file: "utPLSQL"
- utplsql_version: "develop"
jdk: '10'
utplsql_file: "utPLSQL"
- utplsql_version: "develop"
jdk: '11'
utplsql_file: "utPLSQL"
- utplsql_version: "develop"
jdk: '12'
utplsql_file: "utPLSQL"
- utplsql_version: "develop"
jdk: '13'
utplsql_file: "utPLSQL"
services:
oracle:
image: gvenzl/oracle-xe:18.4.0-slim
env:
ORACLE_PASSWORD: oracle
ports:
- 1521:1521
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
--name oracle
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{matrix.jdk}}
cache: 'gradle'
- name: Install utplsql
run: .travis/install_utplsql.sh
- name: Install demo project
run: .travis/install_demo_project.sh
- name: Build and test
run: ./gradlew check
deploy:
name: Deploy snapshot
needs: [ build ]
concurrency: deploy
runs-on: ubuntu-latest
if: |
github.repository == 'utPLSQL/utPLSQL-java-api' &&
github.base_ref == null &&
(github.ref == 'refs/heads/develop' || startsWith( github.ref, 'refs/tags/v' ) )
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
cache: 'gradle'
- name: Set env variable
uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action
- name: Set CI_TAG
run: if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then echo "CI_TAG=${CI_REF}" >> ${GITHUB_ENV}; fi
- name: Debug
run: echo "GITHUB_REF_TYPE=${GITHUB_REF_TYPE}; CI_TAG=${CI_TAG}; CI_REF=${CI_REF}"
- name: Set CI_BRANCH
run: if [[ "${GITHUB_REF_TYPE}" == "branch" ]]; then echo "CI_BRANCH=${CI_REF}" >> ${GITHUB_ENV}; fi
- name: Debug
run: echo "GITHUB_REF_TYPE=${GITHUB_REF_TYPE}; CI_BRANCH=${CI_BRANCH}; CI_REF=${CI_REF}"
- name: Upload archives
env:
PACKAGECLOUD_TOKEN: ${{secrets.PACKAGECLOUD_TOKEN}}
run: ./gradlew uploadArchives
dispatch:
name: Dispatch downstream builds
concurrency: trigger
needs: [ build, deploy ]
runs-on: ubuntu-latest
if: |
github.repository == 'utPLSQL/utPLSQL-java-api' && github.base_ref == null && github.ref == 'refs/heads/develop'
strategy:
matrix:
repo: ['utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-cli']
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.API_TOKEN_GITHUB }}
repository: ${{ matrix.repo }}
event-type: utPLSQL-java-api-build
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: [ build, deploy, dispatch ]
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
name: 'Github Actions[bot]'
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'