Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0354c1a
First attempt at running as github actions
jgebal Nov 24, 2021
de73451
Building github actions
jgebal Nov 24, 2021
1c3004a
Adding OJDBC Download
jgebal Nov 25, 2021
0b9f937
Adding TimeZone
jgebal Nov 25, 2021
0ce0368
Adding 21xe-full
jgebal Nov 25, 2021
4921610
Switching to 21c-xe-slim
jgebal Nov 30, 2021
09d3261
Fixing build numbers and sonar analysis configuration.
jgebal Dec 2, 2021
e3e8c79
Added update of project version and build number.
jgebal Jan 4, 2022
e841b9b
Fixing docs update
jgebal Jan 5, 2022
cae6a35
Update env variables
jgebal Jan 5, 2022
7e87558
Formatting and cleanup
jgebal Jan 5, 2022
9307524
Adding publishing of project version updates
jgebal Jan 5, 2022
169f61c
Update of token
jgebal Jan 6, 2022
82c4d21
Testing publishing of documentation to gh-pages
jgebal Jan 6, 2022
532be8d
Externalizing env variables.
jgebal Jan 6, 2022
12757ea
Added job names.
jgebal Jan 7, 2022
ddd3862
Fixing multi-line if statement.
jgebal Jan 7, 2022
5b64836
Implementing Release Action
jgebal Jan 7, 2022
28cdee3
Refactoring and adding dispatch of other repositories
jgebal Jan 8, 2022
0e6eb70
Testing triggering of build process on other repositories
jgebal Jan 9, 2022
06f3556
Enabling build and slack notification
jgebal Jan 10, 2022
6cd8b16
Update documentation publish condition
jgebal Jan 10, 2022
1fc87de
Enable dependency on downstream job dispatch
jgebal Jan 10, 2022
31cc42d
Final cleanup of travis build leftovers.
jgebal Jan 13, 2022
b94a3f7
Addding `utPLSQL-java-api` repo to dispatch post-build.
jgebal Jan 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enabling build and slack notification
  • Loading branch information
jgebal committed Jan 13, 2022
commit 06f35569d226984d6d929082d9f00a4ee4efc09e
348 changes: 174 additions & 174 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,165 +14,165 @@ defaults:

jobs:

# build:
# name: Build and test on ${{matrix.db_version_name}} DB
# runs-on: ubuntu-latest
# env:
# ORACLE_VERSION: ${{matrix.oracle-version}}
# CONNECTION_STR: ${{matrix.connection-str}}
# ORACLE_PASSWORD: oracle
# DOCKER_VOLUME: ${{matrix.docker-volume}}
# strategy:
# fail-fast: false
# matrix:
# include:
# - oracle-version: "gvenzl/oracle-xe:11-full"
# connection-str: '127.0.0.1:1521/XE'
# id: 1
# db_version_name: '11xe'
## TODO - need to add healthcheck.sh into our containers
## - oracle-version: "utplsqlv3/oracledb:12c-r1-se2-small"
## connection-str: '127.0.0.1:1521/ORCLCDB'
## id: 2
## db_version_name: '12.1se'
## - oracle-version: "utplsqlv3/oracledb:12c-r2-se2-small"
## connection-str: '127.0.0.1:1521/ORCLCDB'
## id: 3
## db_version_name: '12.2se'
# - oracle-version: "gvenzl/oracle-xe:18-slim"
# connection-str: '127.0.0.1:1521/XE'
# id: 4
# db_version_name: '18xe'
## - oracle-version: "utplsqlv3/oracledb:18c-se2-small"
## connection-str: '127.0.0.1:1521/ORCLCDB'
## id: 5
## db_version_name: '18se'
## - oracle-version: "utplsqlv3/oracledb:19c-se2-small"
## connection-str: '127.0.0.1:1521/ORCLCDB'
## id: 6
## db_version_name: '19se'
# - oracle-version: "gvenzl/oracle-xe:21-slim"
# connection-str: '127.0.0.1:1521/XE'
# id: 7
# db_version_name: '21xe'
#
# services:
# oracle:
# image: ${{matrix.oracle-version}}
# env:
# ORACLE_PASSWORD: oracle
# MATRIX_JOB_ID: ${{matrix.id}}
# credentials:
# username: ${{ secrets.DOCKER_USER }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# ports:
# - 1521:1521
# options: >-
# --health-cmd healthcheck.sh
# --health-interval 10s
# --health-timeout 5s
# --health-retries 10
#
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: c-py/action-dotenv-to-setenv@v2
# with:
# env-file: .github/variables/.env
# - uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action
#
# - name: Set build version number env variables
# id: set-build-version-number-vars
# run: .github/scripts/set_version_numbers_env.sh
#
# - name: Update project version & build number to verify that code is deployable after the update
# id: update-project-version
# run: .github/scripts/update_project_version.sh
#
# - name: Download utPLSQL release for testing
## For PR build - test using target branch as framework, for branch build use self as testing framework
# run: git clone --depth=1 --branch=${CI_HEAD_REF:-$CI_REF_NAME} https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR
#
# - name: Update privileges on sources
# run: chmod -R go+w ./{source,test,examples,${UTPLSQL_DIR}/source}
#
# - name: Add OJDBC home
# id: get-ojdbc
# 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
#
# - name: Install utPLSQL-cli
# id: install-utplsql-cli
# 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
#
# - name: Install utPLSQL
# id: install-utplsql
# run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install.sh
#
# - name: Install utPLSQL release
# id: install-utplsql-release
# run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install_utplsql_release.sh
#
# - name: Run Examples
# id: run-examples
# run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/run_examples.sh
#
# - name: Install tests
# id: install-tests
# run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} test/install_tests.sh
#
# - name: Run Tests
# id: run-tests
# run: bash test/run_tests.sh
#
# - name: Validate utPLSQL reports format
# id: validate-reports-format
# run: bash .github/scripts/validate_report_files.sh
#
# - name: SonarCloud Scan
# id: sonar
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
#
# publish:
# name: Deploy documentation
# needs: [ build ]
# concurrency: publish
# runs-on: ubuntu-latest
# if: |
# github.repository == 'utPLSQL/utPLSQL' &&
# github.base_ref == null &&
# ( startsWith( github.ref, 'refs/heads/release/v' )
# || github.ref == 'refs/heads/develop'
# || github.ref == 'refs/heads/feature/github_actions'
# )
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: c-py/action-dotenv-to-setenv@v2
# with:
# env-file: .github/variables/.env
# - uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action
# - name: Set buid version number env variables
# id: set-build-version-number-vars
# run: .github/scripts/set_version_numbers_env.sh
# - name: Update project version & build number in source code and documentation
# id: update-project-version
# run: .github/scripts/update_project_version.sh
# - name: Push version update to repository
# id: push-version-number-update
# run: |
# git add sonar-project.properties VERSION source/* docs/*
# git commit -m 'Updated project version after build [skip ci]'
# git push --quiet origin HEAD:${CI_ACTION_REF_NAME}
# - name: Copy and push documentation to utPLSQL-github-io repo
# id: push-documentation
# env:
# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
# run: .github/scripts/push_docs_to_github_io.sh
build:
name: Build and test on ${{matrix.db_version_name}} DB
runs-on: ubuntu-latest
env:
ORACLE_VERSION: ${{matrix.oracle-version}}
CONNECTION_STR: ${{matrix.connection-str}}
ORACLE_PASSWORD: oracle
DOCKER_VOLUME: ${{matrix.docker-volume}}
strategy:
fail-fast: false
matrix:
include:
- oracle-version: "gvenzl/oracle-xe:11-full"
connection-str: '127.0.0.1:1521/XE'
id: 1
db_version_name: '11xe'
# TODO - need to add healthcheck.sh into our containers
# - oracle-version: "utplsqlv3/oracledb:12c-r1-se2-small"
# connection-str: '127.0.0.1:1521/ORCLCDB'
# id: 2
# db_version_name: '12.1se'
# - oracle-version: "utplsqlv3/oracledb:12c-r2-se2-small"
# connection-str: '127.0.0.1:1521/ORCLCDB'
# id: 3
# db_version_name: '12.2se'
- oracle-version: "gvenzl/oracle-xe:18-slim"
connection-str: '127.0.0.1:1521/XE'
id: 4
db_version_name: '18xe'
# - oracle-version: "utplsqlv3/oracledb:18c-se2-small"
# connection-str: '127.0.0.1:1521/ORCLCDB'
# id: 5
# db_version_name: '18se'
# - oracle-version: "utplsqlv3/oracledb:19c-se2-small"
# connection-str: '127.0.0.1:1521/ORCLCDB'
# id: 6
# db_version_name: '19se'
- oracle-version: "gvenzl/oracle-xe:21-slim"
connection-str: '127.0.0.1:1521/XE'
id: 7
db_version_name: '21xe'

services:
oracle:
image: ${{matrix.oracle-version}}
env:
ORACLE_PASSWORD: oracle
MATRIX_JOB_ID: ${{matrix.id}}
credentials:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
ports:
- 1521:1521
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: c-py/action-dotenv-to-setenv@v2
with:
env-file: .github/variables/.env
- uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action

- name: Set build version number env variables
id: set-build-version-number-vars
run: .github/scripts/set_version_numbers_env.sh

- name: Update project version & build number to verify that code is deployable after the update
id: update-project-version
run: .github/scripts/update_project_version.sh

- name: Download utPLSQL release for testing
# For PR build - test using target branch as framework, for branch build use self as testing framework
run: git clone --depth=1 --branch=${CI_HEAD_REF:-$CI_REF_NAME} https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR

- name: Update privileges on sources
run: chmod -R go+w ./{source,test,examples,${UTPLSQL_DIR}/source}

- name: Add OJDBC home
id: get-ojdbc
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

- name: Install utPLSQL-cli
id: install-utplsql-cli
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

- name: Install utPLSQL
id: install-utplsql
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install.sh

- name: Install utPLSQL release
id: install-utplsql-release
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/install_utplsql_release.sh

- name: Run Examples
id: run-examples
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .github/scripts/run_examples.sh

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

- name: Run Tests
id: run-tests
run: bash test/run_tests.sh

- name: Validate utPLSQL reports format
id: validate-reports-format
run: bash .github/scripts/validate_report_files.sh

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

publish:
name: Deploy documentation
needs: [ build ]
concurrency: publish
runs-on: ubuntu-latest
if: |
github.repository == 'utPLSQL/utPLSQL' &&
github.base_ref == null &&
( startsWith( github.ref, 'refs/heads/release/v' )
|| github.ref == 'refs/heads/develop'
|| github.ref == 'refs/heads/feature/github_actions'
)
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: c-py/action-dotenv-to-setenv@v2
with:
env-file: .github/variables/.env
- uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action
- name: Set buid version number env variables
id: set-build-version-number-vars
run: .github/scripts/set_version_numbers_env.sh
- name: Update project version & build number in source code and documentation
id: update-project-version
run: .github/scripts/update_project_version.sh
- name: Push version update to repository
id: push-version-number-update
run: |
git add sonar-project.properties VERSION source/* docs/*
git commit -m 'Updated project version after build [skip ci]'
git push --quiet origin HEAD:${CI_ACTION_REF_NAME}
- name: Copy and push documentation to utPLSQL-github-io repo
id: push-documentation
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: .github/scripts/push_docs_to_github_io.sh

dispatch:
name: Dispatch downstream builds
Expand All @@ -198,18 +198,18 @@ jobs:
repository: ${{ matrix.repo }}
event-type: utPLSQL-build

# slack-workflow-status:
# if: always()
# name: Post Workflow Status To Slack
# needs: [ build, publish, dispatch ]
# runs-on: ubuntu-latest
# steps:
# - name: Slack Workflow Notification
# uses: Gamesight/slack-workflow-status@master
# with:
# # Required Input
# repo_token: ${{secrets.GITHUB_TOKEN}}
# slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
# # Optional Input
# name: 'Github Actions[bot]'
# icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: [ build, publish, dispatch ]
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
# Required Input
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
# Optional Input
name: 'Github Actions[bot]'
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'