Skip to content
Merged
Show file tree
Hide file tree
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
Refactoring and adding dispatch of other repositories
  • Loading branch information
jgebal committed Jan 13, 2022
commit 28cdee35174e069113e3e22048fe53a52501a496
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.travis.yml export-ignore
mkdocs.yml export-ignore
.travis export-ignore
.github export-ignore
sonar-project.properties export-ignore
tests export-ignore
development export-ignore
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .travis/install.sh → .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ev
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd ${SCRIPT_DIR}/../source
cd ${SCRIPT_DIR}/../../source

INSTALL_FILE="install_headless_with_trigger.sql"
if [[ ! -f "${INSTALL_FILE}" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ev
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd ${SCRIPT_DIR}/../${UTPLSQL_DIR}/source
cd ${SCRIPT_DIR}/../../${UTPLSQL_DIR}/source

"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<SQL
set serveroutput on
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - index.md logging doc history

# How to run:
# - From repository root .travis/push_docs_to_gh_pages.sh
# - From repository root .github/scripts/push_docs_to_gh_pages.sh

# Required files / directories (relative from repo root)
# - File: "docs/index.md" with that contains develop docs
Expand All @@ -16,7 +16,7 @@
LATEST_DOCS_BRANCH="develop"
GITHUB_IO_REPO='utPLSQL/utPLSQL.github.io'
GITHUB_IO_BRANCH='main'

DOCS_DIR='../../docs/.'

# ENV Variable checks are to help with configuration troubleshooting, they silently exit with unique message.
# Anyone one of them not set can be used to turn off this functionality.
Expand All @@ -40,18 +40,18 @@ cd ./utPLSQL
echo "updating 'develop' documentation directory"
mkdir -p ./develop
rm -rf ./develop/**./* || exit 0
cp -a ../../docs/. ./develop
cp -a ${DOCS_DIR} ./develop

# If a Tagged Build then copy to it's own directory as well and to the 'latest' release directory
if [ "${GITHUB_REF_TYPE}" == "tag" ]; then
echo "Creating directory ./${UTPLSQL_VERSION}"
mkdir -p ./${UTPLSQL_VERSION}
rm -rf ./${UTPLSQL_VERSION}/**./* || exit 0
cp -a ../../docs/. ./${UTPLSQL_VERSION}
cp -a ${DOCS_DIR} ./${UTPLSQL_VERSION}
echo "Populating 'latest' directory"
mkdir -p ./latest
rm -rf ./latest/**./* || exit 0
cp -a ../../docs/. ./latest
cp -a ${DOCS_DIR} ./latest
fi
# Stage changes for commit
git add .
Expand All @@ -67,7 +67,7 @@ if [ ! -f index.md ]; then
echo "---" >>index.md
echo "layout: default" >>index.md
echo "---" >>index.md
echo "<!-- Auto generated from .travis/push_docs_to_github_io.sh -->" >>index.md
echo "<!-- Auto generated from .github/scripts/push_docs_to_github_io.sh -->" >>index.md
echo "# Documentation versions" >>index.md
echo "" >>index.md
echo "" >>index.md #- 7th line - placeholder for latest release doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ev
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd ${SCRIPT_DIR}/../examples
cd ${SCRIPT_DIR}/../../examples

"$SQLCLI" $UT3_DEVELOP_SCHEMA/$UT3_DEVELOP_SCHEMA_PASSWORD@//$CONNECTION_STR <<SQL

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/set_version_numbers_env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

UTPLSQL_BUILD_NO=$( expr ${GITHUB_RUN_NUMBER} + ${UTPLSQL_BUILD_NO_OFFSET} )
UTPLSQL_VERSION=$(.travis/get_project_version.sh)
UTPLSQL_VERSION=$(.github/scripts/get_project_version.sh)

echo "UTPLSQL_BUILD_NO=${UTPLSQL_BUILD_NO}" >> $GITHUB_ENV
echo "UTPLSQL_VERSION=${UTPLSQL_VERSION}" >> $GITHUB_ENV
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

GL_VALID=1
XSD_DIR=".travis/xsd"
XML_JAR_DIR=".travis/lib"
XSD_DIR="${SCRIPT_DIR}/xsd"
XML_JAR_DIR="${SCRIPT_DIR}/lib"
#XML Validator
XML_VALIDATOR="$XML_JAR_DIR/xml_validator.jar"
HTML_VALIDATOR_URL="https://validator.w3.org/nu/"
Expand Down
File renamed without changes.
File renamed without changes.
93 changes: 43 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Build, test, deploy documentation

on:
push:
branches: [ develop, feature/github_actions ]
branches-ignore: [ main ]
pull_request:
branches: [ develop ]

Expand All @@ -15,7 +14,7 @@ defaults:

jobs:

build-and-test:
build:
name: Build and test on ${{matrix.db_version_name}} DB
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -83,43 +82,17 @@ jobs:
env-file: .github/variables/.env
- uses: FranzDiebold/github-env-vars-action@v2 #https://github.com/marketplace/actions/github-environment-variables-action

- name: Print environment variables
run: |
echo "CI_REPOSITORY_SLUG=$CI_REPOSITORY_SLUG"
echo "CI_REPOSITORY_OWNER=$CI_REPOSITORY_OWNER"
echo "CI_REPOSITORY_OWNER_SLUG=$CI_REPOSITORY_OWNER_SLUG"
echo "CI_REPOSITORY_NAME=$CI_REPOSITORY_NAME"
echo "CI_REPOSITORY_NAME_SLUG=$CI_REPOSITORY_NAME_SLUG"
echo "CI_REPOSITORY=$CI_REPOSITORY"
echo "CI_REF_SLUG=$CI_REF_SLUG"
echo "CI_ACTION_REF_NAME=$CI_ACTION_REF_NAME"
echo "CI_ACTION_REF_NAME_SLUG=$CI_ACTION_REF_NAME_SLUG"
echo "CI_REF_NAME=$CI_REF_NAME"
echo "CI_REF_NAME_SLUG=$CI_REF_NAME_SLUG"
echo "CI_REF=$CI_REF"
echo "CI_HEAD_REF_SLUG=$CI_HEAD_REF_SLUG"
echo "CI_HEAD_REF=$CI_HEAD_REF"
echo "CI_BASE_REF_SLUG=$CI_BASE_REF_SLUG"
echo "CI_BASE_REF=$CI_BASE_REF"
echo "CI_SHA_SHORT=$CI_SHA_SHORT"
echo "CI_SHA=$CI_SHA"
echo "CI_ACTOR=$CI_ACTOR"
echo "CI_EVENT_NAME=$CI_EVENT_NAME"
echo "CI_RUN_ID=$CI_RUN_ID"
echo "CI_RUN_NUMBER=$CI_RUN_NUMBER"
echo "CI_WORKFLOW=$CI_WORKFLOW"
echo "CI_ACTION=$CI_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: .travis/update_project_version.sh
run: .github/scripts/update_project_version.sh

- name: Download latest utPLSQL release
run: git clone --depth=1 --branch=main https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR
- 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}
Expand All @@ -134,27 +107,27 @@ jobs:

- name: Install utPLSQL
id: install-utplsql
run: docker run --rm -v $(pwd):/utPLSQL -w /utPLSQL --network host --entrypoint bash ${DOCKER_ENV} ${ORACLE_VERSION} .travis/install.sh
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} ./.travis/install_utplsql_release.sh
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} ./.travis/run_examples.sh
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
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 .travis/validate_report_files.sh
run: bash .github/scripts/validate_report_files.sh

- name: SonarCloud Scan
id: sonar
Expand All @@ -165,15 +138,16 @@ jobs:

publish:
name: Deploy documentation
needs: [ build-and-test ]
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' )

( 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:
Expand All @@ -182,32 +156,52 @@ jobs:
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: .travis/update_project_version.sh

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: .travis/push_docs_to_github_io.sh
run: .github/scripts/push_docs_to_github_io.sh

dispatch:
name: Dispatch downstream builds
concurrency: trigger
needs: [ build, 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'
)
strategy:
matrix:
repo: ['utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-demo-project']
# repo: ['utPLSQL/utPLSQL-java-api', 'utPLSQL/utPLSQL-v2-v3-migration', 'utPLSQL/utPLSQL-cli', 'utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-demo-project']
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.API_TOKEN_GITHUB }}
repository: ${{ matrix.repo }}
event-type: utPLSQL-build

slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: [ build-and-test, publish ]
needs: [ build, publish, dispatch ]
runs-on: ubuntu-latest
steps:
- name: Slack Workflow Notification
Expand All @@ -219,4 +213,3 @@ jobs:
# Optional Input
name: 'Github Actions[bot]'
icon_url: 'https://octodex.github.com/images/mona-the-rivetertocat.png'
#TODO - add triggering of builds on other repositories
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
git config --global user.name "github-actions[bot]"

- name: Update project version & build number in source code and documentation
run: .travis/update_project_version.sh
run: .github/scripts/update_project_version.sh

- name: Copy and push documentation to utPLSQL-github-io repo
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: .travis/push_docs_to_github_io.sh
run: .github/scripts/push_docs_to_github_io.sh

upload_artifacts:
name: Upload archives
Expand All @@ -50,7 +50,7 @@ jobs:
with:
fetch-depth: 0
- name: Update project version & build number in source code and documentation
run: .travis/update_project_version.sh
run: .github/scripts/update_project_version.sh

- name: Setup git config
run: |
Expand Down
4 changes: 2 additions & 2 deletions development/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ if ! development/cleanup.sh; then
echo -e ${header}"\nFailed to cleanup utPLSQL environment\n"${header}
exit 1
fi
if ! .travis/install.sh; then
if ! .github/scripts/install.sh; then
echo -e ${header}"\nFailed to install utPLSQL from current branch into ${UT3_DEVELOP_SCHEMA} schema\n"${header}
exit 1
fi
if ! .travis/install_utplsql_release.sh; then
if ! .github/scripts/install_utplsql_release.sh; then
echo -e ${header}"\nFailed to install utPLSQL from branch ${SELFTESTING_BRANCH} into ${UT3_RELEASE_VERSION_SCHEMA}\n"${header}
exit 1
fi
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ To sign up to the chat use [this link](https://join.slack.com/t/utplsql/shared_i
----------
__Project Directories__

* .github - contains files needed for github Actions integration
* .travis - contains files needed for travis-ci integration
* client_source - Sources to be used on the client-side. Developer workstation or CI platform to run the tests.
* development - Set of useful scripts and utilities for development and debugging of utPLSQL
Expand Down