8000 Add build process using Github Actions by jgebal · Pull Request #1175 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content

Add build process using Github Actions #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jan 14, 2022
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
Added job names.
Added id for matrix jobs.
Adding slack notification.
Adding semaphore to prevent concurrency when publishing documentation.
  • Loading branch information
jgebal committed Jan 13, 2022
commit 12757eaa7eeeb728950f742226956b253c50a716
64 changes: 56 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test
name: Build, test, deploy documentation
env:
BUILD_DIR: ${{github.workspace}}
JOB_NUMBER: ${{github.run_number}}
Expand All @@ -11,13 +11,16 @@ on:

workflow_dispatch:

concurrency: ${{github.ref}}

defaults:
run:
shell: bash

jobs:

build:
build-and-test:
name: Build and test on ${{matrix.db_version_name}} DB
env:
ORACLE_VERSION: ${{matrix.oracle-version}}
CONNECTION_STR: ${{matrix.connection-str}}
Expand All @@ -31,19 +34,33 @@ jobs:
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:
Expand Down Expand Up @@ -71,50 +88,63 @@ jobs:
env-file: .github/variables/.env


- name: Set buid version number env variables
- 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

- name: Download latest utPLSQL release
run: git clone --depth=1 --branch=main 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: Update privileges on sources
run: chmod -R go+w ./{source,test,examples,${UTPLSQL_DIR}/source}

- 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

- 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

- 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

- 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 .travis/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:
needs: build
name: Deploy documentation
needs: [build-and-test]
concurrency: publish
runs-on: ubuntu-latest
if: |
${{ github.repository == 'utPLSQL/utPLSQL' && github.base_ref == null
Expand All @@ -132,17 +162,35 @@ jobs:
env-file: .github/variables/.env

- 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

- name: Push version update to repository
id: push-version-number-update
run: .travis/push_project_version.sh

- 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

# TODO - add slack notifications
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: [build-and-test, publish]
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'
1 change: 1 addition & 0 deletions .github/workflows/release_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ defaults:
jobs:

publish:
concurrency: publish
runs-on: ubuntu-latest

steps:
Expand Down
0