|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + schedule: |
| 9 | + - cron: "23 5 * * 1" |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + workflow-lint: |
| 21 | + name: GitHub Actions static validation |
| 22 | + runs-on: ubuntu-latest |
| 23 | + timeout-minutes: 5 |
| 24 | + steps: |
| 25 | + - name: Check out the repository |
| 26 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 27 | + with: |
| 28 | + persist-credentials: false |
| 29 | + - name: Set up Node.js 24 |
| 30 | + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 |
| 31 | + with: |
| 32 | + node-version: 24.x |
| 33 | + - name: Validate Public Preview content and identity |
| 34 | + run: npm run check:public-preview |
| 35 | + - name: Download the pinned actionlint release |
| 36 | + id: actionlint |
| 37 | + shell: bash |
| 38 | + run: | |
| 39 | + set -euo pipefail |
| 40 | + version="$(tr -d '\n' < .github/actionlint-version)" |
| 41 | + asset="actionlint_${version}_linux_amd64.tar.gz" |
| 42 | + base="https://github.com/rhysd/actionlint/releases/download/v${version}" |
| 43 | + curl --fail --location --proto '=https' --retry 3 --silent --show-error \ |
| 44 | + "$base/$asset" --output "$RUNNER_TEMP/$asset" |
| 45 | + expected="$(awk -v file="$asset" '$2 == file { print $1 }' .github/actionlint-checksums.txt)" |
| 46 | + actual="$(sha256sum "$RUNNER_TEMP/$asset" | awk '{ print $1 }')" |
| 47 | + if [[ -z "$expected" || "$actual" != "$expected" ]]; then |
| 48 | + echo "actionlint release checksum verification failed." >&2 |
| 49 | + exit 1 |
| 50 | + fi |
| 51 | + tar -xzf "$RUNNER_TEMP/$asset" -C "$RUNNER_TEMP" actionlint |
| 52 | + echo "binary=$RUNNER_TEMP/actionlint" >> "$GITHUB_OUTPUT" |
| 53 | + - name: Validate all workflows |
| 54 | + env: |
| 55 | + ACTIONLINT_BIN: ${{ steps.actionlint.outputs.binary }} |
| 56 | + run: npm run actionlint |
| 57 | + |
| 58 | + locked: |
| 59 | + name: Locked OpenAI / Node.js ${{ matrix.node-version }} |
| 60 | + runs-on: ubuntu-latest |
| 61 | + timeout-minutes: 25 |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + node-version: |
| 66 | + - 22.x |
| 67 | + - 24.x |
| 68 | + steps: |
| 69 | + - name: Check out the repository |
| 70 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 71 | + with: |
| 72 | + persist-credentials: false |
| 73 | + - name: Set up Node.js ${{ matrix.node-version }} |
| 74 | + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 |
| 75 | + with: |
| 76 | + node-version: ${{ matrix.node-version }} |
| 77 | + cache: npm |
| 78 | + - name: Install locked dependencies |
| 79 | + run: npm ci |
| 80 | + - name: Check formatting |
| 81 | + run: npm run format:check |
| 82 | + - name: Lint |
| 83 | + run: npm run lint |
| 84 | + - name: Type-check |
| 85 | + run: npm run typecheck |
| 86 | + - name: Run unit and mocked contract tests |
| 87 | + run: npm test |
| 88 | + - name: Scan tracked material for secret patterns |
| 89 | + run: npm run test:secrets |
| 90 | + - name: Build ESM and CommonJS outputs |
| 91 | + run: npm run build |
| 92 | + - name: Validate the package shape |
| 93 | + run: npm run test:package |
| 94 | + - name: Verify live-smoke semantic checks with mocked transport |
| 95 | + run: npm run test:live-contract |
| 96 | + - name: Test packed-package fixtures |
| 97 | + run: npm run test:fixtures |
| 98 | + |
| 99 | + minimum-openai: |
| 100 | + name: Minimum OpenAI / Node.js 22 |
| 101 | + runs-on: ubuntu-latest |
| 102 | + timeout-minutes: 20 |
| 103 | + steps: |
| 104 | + - name: Check out the repository |
| 105 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 106 | + with: |
| 107 | + persist-credentials: false |
| 108 | + - name: Set up Node.js 22 |
| 109 | + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 |
| 110 | + with: |
| 111 | + node-version: 22.x |
| 112 | + cache: npm |
| 113 | + - name: Install locked development dependencies |
| 114 | + run: npm ci |
| 115 | + - name: Test the minimum supported OpenAI version |
| 116 | + run: npm run test:compat -- --lane minimum |
| 117 | + |
| 118 | + latest-openai: |
| 119 | + name: Latest OpenAI 6.x canary / Node.js 24 |
| 120 | + if: >- |
| 121 | + github.event_name == 'schedule' || |
| 122 | + (github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') |
| 123 | + runs-on: ubuntu-latest |
| 124 | + timeout-minutes: 20 |
| 125 | + steps: |
| 126 | + - name: Check out the repository |
| 127 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 128 | + with: |
| 129 | + persist-credentials: false |
| 130 | + - name: Set up Node.js 24 |
| 131 | + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 |
| 132 | + with: |
| 133 | + node-version: 24.x |
| 134 | + cache: npm |
| 135 | + - name: Install locked development dependencies |
| 136 | + run: npm ci |
| 137 | + - name: Test the latest compatible OpenAI version |
| 138 | + run: npm run test:compat -- --lane latest |
| 139 | + |
| 140 | + current-node-advisory: |
| 141 | + name: Node.js 26 advisory |
| 142 | + continue-on-error: true |
| 143 | + runs-on: ubuntu-latest |
| 144 | + timeout-minutes: 20 |
| 145 | + steps: |
| 146 | + - name: Check out the repository |
| 147 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 148 | + with: |
| 149 | + persist-credentials: false |
| 150 | + - name: Set up Node.js 26 |
| 151 | + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 |
| 152 | + with: |
| 153 | + node-version: 26.x |
| 154 | + cache: npm |
| 155 | + - name: Install locked dependencies |
| 156 | + run: npm ci |
| 157 | + - name: Type-check |
| 158 | + run: npm run typecheck |
| 159 | + - name: Run unit and mocked contract tests |
| 160 | + run: npm test |
| 161 | + - name: Build ESM and CommonJS outputs |
| 162 | + run: npm run build |
| 163 | + - name: Validate the package shape |
| 164 | + run: npm run test:package |
| 165 | + - name: Verify live-smoke semantic checks with mocked transport |
| 166 | + run: npm run test:live-contract |
| 167 | + |
| 168 | + self-contained: |
| 169 | + name: Standalone repository check |
| 170 | + runs-on: ubuntu-latest |
| 171 | + timeout-minutes: 25 |
| 172 | + steps: |
| 173 | + - name: Check out the repository |
| 174 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 175 | + with: |
| 176 | + persist-credentials: false |
| 177 | + - name: Set up Node.js 24 |
| 178 | + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 |
| 179 | + with: |
| 180 | + node-version: 24.x |
| 181 | + cache: npm |
| 182 | + - name: Install locked dependencies |
| 183 | + run: npm ci |
| 184 | + - name: Copy and verify the standalone repository |
| 185 | + run: npm run check:self-contained |
0 commit comments