|
| 1 | +name: Deploy and test |
| 2 | +env: |
| 3 | + UT3_DEVELOP_SCHEMA: UT3_DEVELOP |
| 4 | + UT3_DEVELOP_SCHEMA_PASSWORD: ut3 |
| 5 | + UT3_RELEASE_VERSION_SCHEMA: UT3 |
| 6 | + UT3_RELEASE_VERSION_SCHEMA_PASSWORD: ut3 |
| 7 | + UT3_USER: 'UT3\$USER#' |
| 8 | + UT3_USER_PASSWORD: ut3 |
| 9 | + UT3_TESTER: UT3_TESTER |
| 10 | + UT3_TESTER_PASSWORD: ut3 |
| 11 | + UT3_TESTER_HELPER: UT3_TESTER_HELPER |
| 12 | + UT3_TESTER_HELPER_PASSWORD: ut3 |
| 13 | + UT3_TABLESPACE: users |
| 14 | + BUILD_DIR: ${{env.GITHUB_WORKSPACE}} |
| 15 | + JOB_ID: ${{env.GITHUB_RUN_ID}} |
| 16 | + JOB_NUMBER: ${{env.GITHUB_RUN_NUMBER}} |
| 17 | + PULL_REQUEST_NAME: ${env.GITHUB_HEAD_REF} |
| 18 | + PULL_REQUEST_BRANCH: ${{env.GITHUB_HEAD_REF}} |
| 19 | + TAG_NAME: ${TRAVIS_TAG} |
| 20 | + REPO_SLUG: ${TRAVIS_REPO_SLUG} |
| 21 | + PR_SLUG: ${{env.GITHUB_REPOSITORY}} |
| 22 | + BRANCH_NAME: ${TRAVIS_BRANCH} |
| 23 | + # Environment for building a release |
| 24 | + CURRENT_BRANCH: ${TRAVIS_BRANCH} |
| 25 | + UTPLSQL_REPO: "utPLSQL/utPLSQL" |
| 26 | + UTPLSQL_BUILD_NO: ${{env.GITHUB_RUN_ID}} |
| 27 | + UTPLSQL_VERSION: $(. .travis/get_project_version.sh) |
| 28 | + UTPLSQL_BUILD_VERSION: $(. .travis/get_project_build_version.sh) |
| 29 | + UTPLSQL_SOURCES_DIR: 'source' |
| 30 | + UTPLSQL_BUILD_USER_NAME: "Travis CI" |
| 31 | + CACHE_DIR: $HOME/.cache |
| 32 | + # Database Env |
| 33 | + SQLCLI: "${BUILD_DIR}/sqlcl/bin/sql" |
| 34 | + OJDBC_HOME: "${BUILD_DIR}/ojdbc" |
| 35 | + ORACLE_PWD: "oracle" |
| 36 | + DOCKHER_HUB_REPO: "utplsqlv3/oracledb" |
| 37 | + DOCKER_VOLUME: "/home/oracle/host" |
| 38 | + DOCKER_ENV: "-e SQLCLI=sqlplus -e UT3_DEVELOP_SCHEMA -e UT3_DEVELOP_SCHEMA_PASSWORD -e UT3_RELEASE_VERSION_SCHEMA -e UT3_RELEASE_VERSION_SCHEMA_PASSWORD -e UT3_USER -e UT3_USER_PASSWORD -e UT3_TESTER -e UT3_TESTER_PASSWORD -e UT3_TESTER_HELPER -e UT3_TESTER_HELPER_PASSWORD -e UT3_TABLESPACE -e ORACLE_PWD -e CONNECTION_STR -e UTPLSQL_DIR" |
| 39 | + #utPLSQL released version directory |
| 40 | + UTPLSQL_DIR: "utPLSQL_latest_release" |
| 41 | + SELFTESTING_BRANCH: ${TRAVIS_BRANCH} |
| 42 | + UTPLSQL_CLI_VERSION: "3.1.8" |
| 43 | + # Maven |
| 44 | + MAVEN_HOME: /usr/local/maven |
| 45 | + MAVEN_CFG: $HOME/.m2 |
| 46 | + |
| 47 | +on: |
| 48 | + push: |
| 49 | + branches: [ develop, feature/github_actions ] |
| 50 | + pull_request: |
| 51 | + branches: [ develop ] |
| 52 | + |
| 53 | + workflow_dispatch: |
| 54 | + |
| 55 | +jobs: |
| 56 | + build: |
| 57 | + |
| 58 | + env: |
| 59 | + UTPLSQL_VERSION: ${{matrix.utplsql-version}} |
| 60 | + |
| 61 | + runs-on: ubuntu-latest |
| 62 | + strategy: |
| 63 | + matrix: |
| 64 | + include: |
| 65 | + - oracle-version: "gvenzl/oracle-xe:11-slim" |
| 66 | + connection-str: '127.0.0.1:1521/XE' |
| 67 | +# docker-options: '--shm-size=1g' |
| 68 | +# - oracle-version: "utplsqlv3/oracledb:12c-r1-se2-small" |
| 69 | +# connection-str: '127.0.0.1:1521/ORCLCDB' |
| 70 | +# - oracle-version: "utplsqlv3/oracledb:12c-r2-se2-small" |
| 71 | +# connection-str: '127.0.0.1:1521/ORCLCDB' |
| 72 | + - oracle-version: "gvenzl/oracle-xe:18-slim" |
| 73 | + connection-str: '127.0.0.1:1521/XE' |
| 74 | + docker-options: '-e ORACLE_PASSWORD=oracle' |
| 75 | +# - oracle-version: "utplsqlv3/oracledb:18c-se2-small" |
| 76 | +# connection-str: '127.0.0.1:1521/ORCLCDB' |
| 77 | +# - oracle-version: "utplsqlv3/oracledb:19c-se2-small" |
| 78 | +# connection-str: '127.0.0.1:1521/ORCLCDB' |
| 79 | + - oracle-version: "gvenzl/oracle-xe:21-full" |
| 80 | + connection-str: '127.0.0.1:1521/XE' |
| 81 | + docker-options: '-e ORACLE_PASSWORD=oracle' |
| 82 | + |
| 83 | + services: |
| 84 | + oracle: |
| 85 | + image: ${matrix.oracle-version} |
| 86 | + env: |
| 87 | + CONNECTION_STR: ${matrix.connection-str} |
| 88 | + ORACLE_PASSWORD: oracle |
| 89 | + ports: |
| 90 | + - 1521:1521 |
| 91 | + options: >- |
| 92 | + --health-cmd healthcheck.sh |
| 93 | + --health-interval 10s |
| 94 | + --health-timeout 5s |
| 95 | + --health-retries 10 |
| 96 | + ${matrix.docker-options} |
| 97 | +
|
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v2 |
| 100 | + with: |
| 101 | + fetch-depth: 0 |
| 102 | + |
| 103 | + - name: Install utPLSQL ${{matrix.utplsql-version}} |
| 104 | + run: echo Installing ${UTPLSQL_VERSION} && sh ${{ github.workspace }}/scripts/1_install_utplsql.sh |
| 105 | + |
| 106 | + - name: Install utPLSQL-cli |
| 107 | + 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 |
| 108 | + |
| 109 | + - name: Install demo project |
| 110 | + run: sh ${{ github.workspace }}/scripts/2_install_demo_project.sh |
| 111 | + |
| 112 | + - name: Install unit tests |
| 113 | + run: sh ${{ github.workspace }}/scripts/3_install_tests.sh |
| 114 | + |
| 115 | + - name: Run unit tests |
| 116 | + run: sh ${{ github.workspace }}/scripts/4_run_tests.sh |
| 117 | + |
| 118 | + - name: SonarCloud Scan |
| 119 | + uses: SonarSource/sonarcloud-github-action@master |
| 120 | + env: |
| 121 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
| 122 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
0 commit comments