Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12757ea

Browse files
committed
Added job names.
Added id for matrix jobs. Adding slack notification. Adding semaphore to prevent concurrency when publishing documentation.
1 parent 532be8d commit 12757ea

2 files changed

Lines changed: 57 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and test
1+
name: Build, test, deploy documentation
22
env:
33
BUILD_DIR: ${{github.workspace}}
44
JOB_NUMBER: ${{github.run_number}}
@@ -11,13 +11,16 @@ on:
1111

1212
workflow_dispatch:
1313

14+
concurrency: ${{github.ref}}
15+
1416
defaults:
1517
run:
1618
shell: bash
1719

1820
jobs:
1921

20-
build:
22+
build-and-test:
23+
name: Build and test on ${{matrix.db_version_name}} DB
2124
env:
2225
ORACLE_VERSION: ${{matrix.oracle-version}}
2326
CONNECTION_STR: ${{matrix.connection-str}}
@@ -31,19 +34,33 @@ jobs:
3134
include:
3235
- oracle-version: "gvenzl/oracle-xe:11-full"
3336
connection-str: '127.0.0.1:1521/XE'
37+
id: 1
38+
db_version_name: '11xe'
3439
# TODO - need to add healthcheck.sh into our containers
3540
# - oracle-version: "utplsqlv3/oracledb:12c-r1-se2-small"
3641
# connection-str: '127.0.0.1:1521/ORCLCDB'
42+
# id: 2
43+
# db_version_name: '12.1se'
3744
# - oracle-version: "utplsqlv3/oracledb:12c-r2-se2-small"
3845
# connection-str: '127.0.0.1:1521/ORCLCDB'
46+
# id: 3
47+
# db_version_name: '12.2se'
3948
- oracle-version: "gvenzl/oracle-xe:18-slim"
4049
connection-str: '127.0.0.1:1521/XE'
50+
id: 4
51+
db_version_name: '18xe'
4152
# - oracle-version: "utplsqlv3/oracledb:18c-se2-small"
4253
# connection-str: '127.0.0.1:1521/ORCLCDB'
54+
# id: 5
55+
# db_version_name: '18se'
4356
# - oracle-version: "utplsqlv3/oracledb:19c-se2-small"
4457
# connection-str: '127.0.0.1:1521/ORCLCDB'
58+
# id: 6
59+
# db_version_name: '19se'
4560
- oracle-version: "gvenzl/oracle-xe:21-slim"
4661
connection-str: '127.0.0.1:1521/XE'
62+
id: 7
63+
db_version_name: '21xe'
4764

4865
services:
4966
oracle:
@@ -71,50 +88,63 @@ jobs:
7188
env-file: .github/variables/.env
7289

7390

74-
- name: Set buid version number env variables
91+
- name: Set build version number env variables
92+
id: set-build-version-number-vars
7593
run: .github/scripts/set_version_numbers_env.sh
7694

7795
- name: Update project version & build number to verify that code is deployable after the update
96+
id: update-project-version
7897
run: .travis/update_project_version.sh
7998

8099
- name: Download latest utPLSQL release
81100
run: git clone --depth=1 --branch=main https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR
82101

102+
- name: Update privileges on sources
103+
run: chmod -R go+w ./{source,test,examples,${UTPLSQL_DIR}/source}
104+
83105
- name: Add OJDBC home
106+
id: get-ojdbc
84107
run: mkdir -p ${OJDBC_HOME} && curl -Lk -o ${OJDBC_HOME}/ojdbc8.jar ${OJDBC_URL}/ojdbc8.jar && curl -Lk -o ${OJDBC_HOME}/orai18n.jar ${OJDBC_URL}/orai18n.jar
85108

86109
- name: Install utPLSQL-cli
110+
id: install-utplsql-cli
87111
run: curl -Lk -o utPLSQL-cli.zip "https://github.com/utPLSQL/utPLSQL-cli/releases/download/v3.1.8/utPLSQL-cli.zip" && unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli
88112

89-
- name: Update privileges on sources
90-
run: chmod -R go+w ./{source,test,examples,${UTPLSQL_DIR}/source}
91-
92113
- name: Install utPLSQL
114+
id: install-utplsql
93115
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .travis/install.sh
94116

95117
- name: Install utPLSQL release
118+
id: install-utplsql-release
96119
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} ./.travis/install_utplsql_release.sh
97120

98121
- name: Run Examples
122+
id: run-examples
99123
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} ./.travis/run_examples.sh
100124

101125
- name: Install tests
126+
id: install-tests
102127
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} ./test/install_tests.sh
103128

104129
- name: Run Tests
130+
id: run-tests
105131
run: bash test/run_tests.sh
106132

107133
- name: Validate utPLSQL reports format
134+
id: validate-reports-format
108135
run: bash .travis/validate_report_files.sh
109136

110137
- name: SonarCloud Scan
138+
id: sonar
111139
uses: SonarSource/sonarcloud-github-action@master
112140
env:
113141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
114142
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
115143

116144
publish:
117-
needs: build
145+
name: Deploy documentation
146+
needs: [build-and-test]
147+
concurrency: publish
118148
runs-on: ubuntu-latest
119149
if: |
120150
${{ github.repository == 'utPLSQL/utPLSQL' && github.base_ref == null
@@ -132,17 +162,35 @@ jobs:
132162
env-file: .github/variables/.env
133163

134164
- name: Set buid version number env variables
165+
id: set-build-version-number-vars
135166
run: .github/scripts/set_version_numbers_env.sh
136167

137168
- name: Update project version & build number in source code and documentation
169+
id: update-project-version
138170
run: .travis/update_project_version.sh
139171

140172
- name: Push version update to repository
173+
id: push-version-number-update
141174
run: .travis/push_project_version.sh
142175

143176
- name: Copy and push documentation to utPLSQL-github-io repo
177+
id: push-documentation
144178
env:
145179
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
146180
run: .travis/push_docs_to_github_io.sh
147181

148-
# TODO - add slack notifications
182+
slack-workflow-status:
183+
if: always()
184+
name: Post Workflow Status To Slack
185+
needs: [build-and-test, publish]
186+
runs-on: ubuntu-latest
187+
steps:
188+
- name: Slack Workflow Notification
189+
uses: Gamesight/slack-workflow-status@master
190+
with:
191+
# Required Input
192+
repo_token: ${{secrets.GITHUB_TOKEN}}
193+
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
194+
# Optional Input
195+
name: 'Github Actions[bot]'
196+
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'

.github/workflows/release_documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ defaults:
1919
jobs:
2020

2121
publish:
22+
concurrency: publish
2223
runs-on: ubuntu-latest
2324

2425
steps:

0 commit comments

Comments
 (0)