Skip to content

Commit 7565854

Browse files
committed
Initial release
0 parents  commit 7565854

4 files changed

Lines changed: 212 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test Action
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-default:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
16+
- name: Setup Oracle Instant Client (default)
17+
id: oracle
18+
uses: ./
19+
with:
20+
version: "19.30.0.0.0"
21+
22+
- name: Verify installation
23+
run: |
24+
echo "ORACLE_HOME=${ORACLE_HOME}"
25+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
26+
echo "Output oracle-home=${{ steps.oracle.outputs.oracle-home }}"
27+
ls -la "${ORACLE_HOME}"
28+
29+
test-basic:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v5
33+
34+
- name: Setup Oracle Instant Client (basic)
35+
uses: ./
36+
with:
37+
version: "19.30.0.0.0"
38+
variant: "basic"
39+
40+
- name: Verify installation
41+
run: |
42+
echo "ORACLE_HOME=${ORACLE_HOME}"
43+
ls -la "${ORACLE_HOME}"
44+
45+
test-v23:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v5
49+
50+
- name: Setup Oracle Instant Client (v23)
51+
uses: ./
52+
with:
53+
version: "23.26.1.0.0"
54+
55+
- name: Verify installation
56+
run: |
57+
echo "ORACLE_HOME=${ORACLE_HOME}"
58+
ls -la "${ORACLE_HOME}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Setup Oracle Instant Client
2+
3+
GitHub Action to download and setup [Oracle Instant Client](https://www.oracle.com/database/technologies/instant-client.html) on Linux GitHub Actions runners.
4+
5+
## Usage
6+
7+
```yaml
8+
steps:
9+
- uses: ishinvin/setup-oracle-instantclient@v1
10+
with:
11+
version: "19.30.0.0.0"
12+
```
13+
14+
### With custom variant
15+
16+
```yaml
17+
steps:
18+
- uses: ishinvin/setup-oracle-instantclient@v1
19+
with:
20+
version: "23.26.1.0.0"
21+
variant: "basic"
22+
```
23+
24+
### Using outputs
25+
26+
```yaml
27+
steps:
28+
- uses: ishinvin/setup-oracle-instantclient@v1
29+
id: oracle
30+
with:
31+
version: "19.30.0.0.0"
32+
33+
- run: echo "Installed to ${{ steps.oracle.outputs.oracle-home }}"
34+
```
35+
36+
## Inputs
37+
38+
| Input | Description | Required | Default |
39+
| --------- | --------------------------------------- | -------- | ----------- |
40+
| `version` | Oracle Instant Client version | Yes | |
41+
| `variant` | Package variant: `basic` or `basiclite` | No | `basiclite` |
42+
43+
## Outputs
44+
45+
| Output | Description |
46+
| ------------- | ---------------------------------------------- |
47+
| `oracle-home` | Path to the Oracle Instant Client installation |
48+
49+
## Available Versions
50+
51+
| Major | Example Versions |
52+
| ----- | ----------------------------- |
53+
| 23.x | `23.26.1.0.0`, `23.9.0.25.07` |
54+
| 21.x | `21.20.0.0.0`, `21.10.0.0.0` |
55+
| 19.x | `19.30.0.0.0`, `19.11.0.0.0` |
56+
57+
> ARM64 runners are only supported for version 23 or later.
58+
59+
## Environment Variables
60+
61+
The action sets the following environment variables:
62+
63+
- `ORACLE_HOME` - Oracle Instant Client installation path
64+
- `LD_LIBRARY_PATH` - Includes Instant Client libraries
65+
- Adds Instant Client directory to `PATH`
66+
67+
## Platform
68+
69+
Linux runners only (Ubuntu). For self-hosted runners, ensure `curl` and `unzip` are installed.
70+
71+
## License
72+
73+
This action is licensed under the MIT License.
74+
75+
Oracle Instant Client is proprietary software owned by Oracle Corporation. By using this action, you agree to the [Oracle Free Use Terms and Conditions](https://www.oracle.com/downloads/licenses/oracle-free-license.html). Oracle Instant Client is downloaded directly from Oracle's official distribution site.

action.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "Setup Oracle Instant Client"
2+
description: "Download and setup Oracle Instant Client on a GitHub Actions runner"
3+
author: "ishinvin"
4+
5+
branding:
6+
icon: "database"
7+
color: "red"
8+
9+
inputs:
10+
version:
11+
description: "Oracle Instant Client version (e.g. 19.30.0.0.0)"
12+
required: true
13+
variant:
14+
description: "Package variant: basic or basiclite"
15+
required: false
16+
default: "basiclite"
17+
18+
outputs:
19+
oracle-home:
20+
description: "Path to the Oracle Instant Client installation"
21+
value: ${{ steps.setup.outputs.oracle-home }}
22+
23+
runs:
24+
using: "composite"
25+
steps:
26+
- name: Download and install Oracle Instant Client
27+
id: setup
28+
shell: bash
29+
env:
30+
VERSION: ${{ inputs.version }}
31+
VARIANT: ${{ inputs.variant }}
32+
run: |
33+
set -euo pipefail
34+
35+
INSTALL_DIR="${RUNNER_TOOL_CACHE}/oracle-instantclient/${VERSION}"
36+
37+
if [[ -d "${INSTALL_DIR}/instantclient" ]]; then
38+
echo "Oracle Instant Client ${VERSION} already installed"
39+
ORACLE_HOME=$(readlink -f "${INSTALL_DIR}/instantclient")
40+
echo "oracle-home=${ORACLE_HOME}" >> "$GITHUB_OUTPUT"
41+
exit 0
42+
fi
43+
44+
# Map architecture
45+
ARCH=$([ "$(uname -m)" = "x86_64" ] && echo "x64" || echo "arm64")
46+
47+
# Build download path segment: 19.30.0.0.0 -> 1930000
48+
PATH_SEGMENT=$(echo "${VERSION}" | tr -d '.')
49+
50+
BASE_URL="https://download.oracle.com/otn_software/linux/instantclient/${PATH_SEGMENT}"
51+
52+
# Download (try with dbru suffix first, then without)
53+
echo "Downloading Oracle Instant Client ${VERSION} (${VARIANT}) for ${ARCH}..."
54+
TMP_DIR=$(mktemp -d)
55+
URL="${BASE_URL}/instantclient-${VARIANT}-linux.${ARCH}-${VERSION}dbru.zip"
56+
if ! curl -fsSL -o "${TMP_DIR}/instantclient.zip" "${URL}" 2>/dev/null; then
57+
URL="${BASE_URL}/instantclient-${VARIANT}-linux.${ARCH}-${VERSION}.zip"
58+
curl -fsSL -o "${TMP_DIR}/instantclient.zip" "${URL}"
59+
fi
60+
61+
# Install
62+
sudo mkdir -p "${INSTALL_DIR}"
63+
sudo unzip -qo "${TMP_DIR}/instantclient.zip" -d "${INSTALL_DIR}"
64+
sudo ln -sf "${INSTALL_DIR}"/instantclient_*/ "${INSTALL_DIR}/instantclient"
65+
rm -rf "${TMP_DIR}"
66+
67+
ORACLE_HOME=$(readlink -f "${INSTALL_DIR}/instantclient")
68+
echo "Installed to: ${ORACLE_HOME}"
69+
echo "oracle-home=${ORACLE_HOME}" >> "$GITHUB_OUTPUT"
70+
71+
- name: Configure environment
72+
shell: bash
73+
env:
74+
ORACLE_HOME: ${{ steps.setup.outputs.oracle-home }}
75+
run: |
76+
echo "ORACLE_HOME=${ORACLE_HOME}" >> "$GITHUB_ENV"
77+
echo "LD_LIBRARY_PATH=${ORACLE_HOME}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
78+
echo "${ORACLE_HOME}" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)