Skip to content

chore(ora): simplify build_modules.js, add linting + libs forward-compat, wire publish workflow [sc-550202] #70

chore(ora): simplify build_modules.js, add linting + libs forward-compat, wire publish workflow [sc-550202]

chore(ora): simplify build_modules.js, add linting + libs forward-compat, wire publish workflow [sc-550202] #70

Workflow file for this run

name: Oracle CI/CD
on:
push:
branches:
- main
paths:
- "clouds/oracle/**"
- ".github/workflows/oracle.yml"
pull_request:
paths:
- "clouds/oracle/**"
- ".github/workflows/oracle.yml"
workflow_dispatch:
workflow_call:
env:
NODE_VERSION: 20.19
PYTHON3_VERSION: 3.10.13
VIRTUALENV_VERSION: 20.15.1
GCLOUD_VERSION: 500.0.0
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 55
env:
ORA_PREFIX: CI_${{ github.run_id }}_${{ github.run_attempt }}_
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check diff
uses: technote-space/get-diff-action@v6
- name: Auth google
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.CARTO_AT_GH_ACTIONS_SERVICE_ACCOUNT_KEY }}
- name: Retrieve secrets
id: get-gcp-secrets
uses: google-github-actions/get-secretmanager-secrets@v2
with:
secrets: |-
ORA_USER:${{ secrets.ORA_USER_NAME_CI }}
ORA_PASSWORD:${{ secrets.ORA_PASSWORD_NAME_CI }}
ORA_WALLET_ZIP:${{ secrets.ORA_WALLET_ZIP_NAME_CI }}
ORA_WALLET_PASSWORD:${{ secrets.ORA_WALLET_PASSWORD_NAME_CI }}
ORA_CONNECTION_STRING:${{ secrets.ORA_CONNECTION_STRING_NAME_CI }}
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup yarn
run: npm install -g yarn
- name: Setup python 3
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON3_VERSION }}
- name: Setup virtualenv
run: pip install virtualenv==${{ env.VIRTUALENV_VERSION }}
- name: Run linter
run: |
cd clouds/oracle
make lint
- name: Run deploy
env:
ORA_USER: ${{ steps.get-gcp-secrets.outputs.ORA_USER }}
ORA_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_PASSWORD }}
ORA_WALLET_ZIP: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_ZIP }}
ORA_WALLET_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_PASSWORD }}
ORA_CONNECTION_STRING: ${{ steps.get-gcp-secrets.outputs.ORA_CONNECTION_STRING }}
run: |
cd clouds/oracle
make deploy diff="$GIT_DIFF"
- name: Run test
env:
ORA_USER: ${{ steps.get-gcp-secrets.outputs.ORA_USER }}
ORA_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_PASSWORD }}
ORA_WALLET_ZIP: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_ZIP }}
ORA_WALLET_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_PASSWORD }}
ORA_CONNECTION_STRING: ${{ steps.get-gcp-secrets.outputs.ORA_CONNECTION_STRING }}
run: |
cd clouds/oracle
make test diff="$GIT_DIFF"
- name: Run remove
if: always()
env:
ORA_USER: ${{ steps.get-gcp-secrets.outputs.ORA_USER }}
ORA_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_PASSWORD }}
ORA_WALLET_ZIP: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_ZIP }}
ORA_WALLET_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_PASSWORD }}
ORA_CONNECTION_STRING: ${{ steps.get-gcp-secrets.outputs.ORA_CONNECTION_STRING }}
run: |
cd clouds/oracle
make remove drop-schema=1
deploy-internal:
if: github.ref_name == 'main'
needs: test
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
matrix:
include:
- target: cd
user: ORA_USER_CD
password: ORA_PASSWORD_CD
wallet_zip: ORA_WALLET_ZIP_CD
wallet_password: ORA_WALLET_PASSWORD_CD
- target: ci
env:
ORA_USER: ${{ secrets[matrix.user] }}
ORA_PASSWORD: ${{ secrets[matrix.password] }}
ORA_WALLET_ZIP: ${{ secrets[matrix.wallet_zip] }}
ORA_WALLET_PASSWORD: ${{ secrets[matrix.wallet_password] }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check diff
uses: technote-space/get-diff-action@v6
- name: Auth google (CI only)
if: matrix.target == 'ci'
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.CARTO_AT_GH_ACTIONS_SERVICE_ACCOUNT_KEY }}
- name: Retrieve secrets (CI only)
if: matrix.target == 'ci'
id: get-gcp-secrets
uses: google-github-actions/get-secretmanager-secrets@v2
with:
secrets: |-
ORA_USER:${{ secrets.ORA_USER_NAME_CI }}
ORA_PASSWORD:${{ secrets.ORA_PASSWORD_NAME_CI }}
ORA_WALLET_ZIP:${{ secrets.ORA_WALLET_ZIP_NAME_CI }}
ORA_WALLET_PASSWORD:${{ secrets.ORA_WALLET_PASSWORD_NAME_CI }}
ORA_CONNECTION_STRING:${{ secrets.ORA_CONNECTION_STRING_NAME_CI }}
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup yarn
run: npm install -g yarn
- name: Setup python 3
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON3_VERSION }}
- name: Setup virtualenv
run: pip install virtualenv==${{ env.VIRTUALENV_VERSION }}
- name: Run deploy
env:
ORA_USER: ${{ steps.get-gcp-secrets.outputs.ORA_USER || secrets[matrix.user] }}
ORA_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_PASSWORD || secrets[matrix.password] }}
ORA_WALLET_ZIP: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_ZIP || secrets[matrix.wallet_zip] }}
ORA_WALLET_PASSWORD: ${{ steps.get-gcp-secrets.outputs.ORA_WALLET_PASSWORD || secrets[matrix.wallet_password] }}
ORA_CONNECTION_STRING: ${{ steps.get-gcp-secrets.outputs.ORA_CONNECTION_STRING }}
run: |
cd clouds/oracle
make deploy production=1