Skip to content

feat: expand codex config surface and custom model aliases (#18) #172

feat: expand codex config surface and custom model aliases (#18)

feat: expand codex config surface and custom model aliases (#18) #172

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
verify:
name: Verify (Node.js 22.x)
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.x
cache: npm
- name: Pin npm version from packageManager
shell: bash
run: |
set -euo pipefail
PKG_MANAGER="$(node -p "JSON.parse(require('node:fs').readFileSync('package.json','utf8')).packageManager")"
case "${PKG_MANAGER}" in
npm@*) NPM_VERSION="${PKG_MANAGER#npm@}" ;;
*) echo "Unsupported packageManager: ${PKG_MANAGER}" >&2; exit 1 ;;
esac
corepack enable || true
corepack prepare "npm@${NPM_VERSION}" --activate || true
if [ "$(npm --version)" != "${NPM_VERSION}" ]; then
echo "npm version mismatch after corepack, falling back to npm install -g"
npm install -g "npm@${NPM_VERSION}"
fi
test "$(npm --version)" = "${NPM_VERSION}"
- name: Install dependencies
run: npm ci
- name: Run verify
env:
COVERAGE_RATCHET_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
COVERAGE_RATCHET_HEAD_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
run: npm run verify
package-smoke:
name: Package Smoke Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.x
cache: npm
- name: Pin npm version from packageManager
shell: bash
run: |
set -euo pipefail
PKG_MANAGER="$(node -p "JSON.parse(require('node:fs').readFileSync('package.json','utf8')).packageManager")"
case "${PKG_MANAGER}" in
npm@*) NPM_VERSION="${PKG_MANAGER#npm@}" ;;
*) echo "Unsupported packageManager: ${PKG_MANAGER}" >&2; exit 1 ;;
esac
corepack enable || true
corepack prepare "npm@${NPM_VERSION}" --activate || true
if [ "$(npm --version)" != "${NPM_VERSION}" ]; then
echo "npm version mismatch after corepack, falling back to npm install -g"
npm install -g "npm@${NPM_VERSION}"
fi
test "$(npm --version)" = "${NPM_VERSION}"
- name: Install dependencies
run: npm ci
- name: Pack and execute CLI tarball
shell: bash
run: |
TARBALL="$(npm pack --silent)"
test -f "${TARBALL}"
TARBALL_PATH="$(node -e "console.log(require('node:path').resolve(process.argv[1]))" "${TARBALL}")"
TMP_DIR="$(mktemp -d)"
npm init -y --prefix "${TMP_DIR}" >/dev/null 2>&1
npm install --silent --prefix "${TMP_DIR}" "${TARBALL_PATH}"
test -f "${TMP_DIR}/node_modules/@iam-brain/opencode-codex-auth/dist/bin/opencode-codex-auth.js"
node "${TMP_DIR}/node_modules/@iam-brain/opencode-codex-auth/dist/bin/opencode-codex-auth.js" --help
package-smoke-windows:
name: Windows Compatibility Smoke
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.x
cache: npm
- name: Pin npm version from packageManager
shell: bash
run: |
set -euo pipefail
PKG_MANAGER="$(node -p "JSON.parse(require('node:fs').readFileSync('package.json','utf8')).packageManager")"
case "${PKG_MANAGER}" in
npm@*) NPM_VERSION="${PKG_MANAGER#npm@}" ;;
*) echo "Unsupported packageManager: ${PKG_MANAGER}" >&2; exit 1 ;;
esac
corepack enable || true
corepack prepare "npm@${NPM_VERSION}" --activate || true
if [ "$(npm --version)" != "${NPM_VERSION}" ]; then
echo "npm version mismatch after corepack, falling back to npm install -g"
npm install -g "npm@${NPM_VERSION}"
fi
test "$(npm --version)" = "${NPM_VERSION}"
- name: Install dependencies
run: npm ci
- name: Pack and execute CLI tarball
shell: bash
run: |
TARBALL="$(npm pack --silent)"
test -f "${TARBALL}"
TARBALL_PATH="$(node -e "console.log(require('node:path').resolve(process.argv[1]))" "${TARBALL}")"
TMP_DIR="$(mktemp -d)"
npm init -y --prefix "${TMP_DIR}" >/dev/null 2>&1
npm install --silent --prefix "${TMP_DIR}" "${TARBALL_PATH}"
test -f "${TMP_DIR}/node_modules/@iam-brain/opencode-codex-auth/dist/bin/opencode-codex-auth.js"
node "${TMP_DIR}/node_modules/@iam-brain/opencode-codex-auth/dist/bin/opencode-codex-auth.js" --help
security-audit:
name: Security Audit
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.x
cache: npm
- name: Pin npm version from packageManager
shell: bash
run: |
set -euo pipefail
PKG_MANAGER="$(node -p "JSON.parse(require('node:fs').readFileSync('package.json','utf8')).packageManager")"
case "${PKG_MANAGER}" in
npm@*) NPM_VERSION="${PKG_MANAGER#npm@}" ;;
*) echo "Unsupported packageManager: ${PKG_MANAGER}" >&2; exit 1 ;;
esac
corepack enable || true
corepack prepare "npm@${NPM_VERSION}" --activate || true
if [ "$(npm --version)" != "${NPM_VERSION}" ]; then
echo "npm version mismatch after corepack, falling back to npm install -g"
npm install -g "npm@${NPM_VERSION}"
fi
test "$(npm --version)" = "${NPM_VERSION}"
- name: Install dependencies
run: npm ci
- name: Audit dependencies (including dev toolchain)
run: npm audit --audit-level=high