Checks / PR 38 #238
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Checks | |
| run-name: Checks / ${{ github.event_name == 'pull_request' && format('PR {0}', github.event.pull_request.number) || github.ref_name }} | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| wasm_target: | |
| description: WASM AOT target to build when WASM runtime inputs are affected | |
| required: true | |
| default: all | |
| type: choice | |
| options: | |
| - all | |
| - aarch64-apple-darwin | |
| - x86_64-unknown-linux-gnu | |
| - aarch64-unknown-linux-gnu | |
| - x86_64-pc-windows-msvc | |
| schedule: | |
| - cron: "41 4 * * 1" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| NODE_VERSION: 22.22.3 | |
| PNPM_VERSION: 11.5.0 | |
| BUN_VERSION: 1.3.8 | |
| ACTIONLINT_VERSION: 1.7.12 | |
| ASSET_PROFILE: release | |
| WASMER_LLVM_VERSION: "22.1" | |
| WASMER_LLVM_LINUX_X64_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/22.x/llvm-linux-amd64.tar.xz | |
| RUST_CACHE_SAVE_IF: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| MOON_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || '' }} | |
| MOON_HEAD: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| affected: | |
| name: affected | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| jobs: ${{ steps.plan.outputs.jobs }} | |
| liboliphaunt_runtime_matrix: ${{ steps.plan.outputs.liboliphaunt_runtime_matrix }} | |
| projects: ${{ steps.plan.outputs.projects }} | |
| tasks: ${{ steps.plan.outputs.tasks }} | |
| wasm_runtime_portable_required: ${{ steps.plan.outputs.wasm_runtime_portable_required }} | |
| reason: ${{ steps.plan.outputs.reason }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| install-workspace: "false" | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Plan affected CI jobs | |
| id: plan | |
| env: | |
| GITHUB_EVENT_NAME: ${{ github.event_name }} | |
| MOON_BASE: ${{ github.event.pull_request.base.sha }} | |
| MOON_HEAD: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: python3 .github/scripts/plan-affected.py | |
| repo: | |
| name: repo | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| permissions: | |
| actions: read | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Rust tools | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| components: rustfmt | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| tools: prek@0.4.3,zizmor@1.25.2 | |
| - name: Install actionlint | |
| run: tools/dev/install-actionlint.sh | |
| - name: Run repository checks | |
| run: | | |
| targets=(repo:check oliphaunt-docs:check policy-tools:check release-tools:check ci-workflows:check) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Collect CI summary | |
| uses: ./.github/actions/collect-ci-summary | |
| release-intent: | |
| name: release-intent | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| persist-credentials: false | |
| - name: Set up Rust tools | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| tools: prek@0.4.3 | |
| - name: Check PR title | |
| if: github.event_name == 'pull_request' | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| printf '%s\n' "$PR_TITLE" > "$RUNNER_TEMP/pr-title.txt" | |
| prek run --stage commit-msg --commit-msg-filename "$RUNNER_TEMP/pr-title.txt" | |
| - name: Check release intent | |
| if: github.event_name == 'pull_request' | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| HEAD_BRANCH: ${{ github.event.pull_request.head.ref }} | |
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: ./.github/scripts/check-release-intent.sh "$PR_TITLE" "$BASE_SHA" "$HEAD_SHA" "$HEAD_BRANCH" | |
| - name: Check HEAD commit subject | |
| run: | | |
| git log -1 --pretty=%s > "$RUNNER_TEMP/head-commit.txt" | |
| prek run --stage commit-msg --commit-msg-filename "$RUNNER_TEMP/head-commit.txt" | |
| liboliphaunt: | |
| name: liboliphaunt (${{ matrix.target }}) | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'liboliphaunt') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.affected.outputs.liboliphaunt_runtime_matrix) }} | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Restore native compiler cache | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 | |
| with: | |
| path: | | |
| ~/.ccache | |
| ${{ matrix.build-root }} | |
| key: liboliphaunt-ccache-${{ matrix.target }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('src/postgres18/**', 'src/third-party/**', 'src/extensions/**', 'src/liboliphaunt/bin/**', 'src/liboliphaunt/include/**', 'src/liboliphaunt/patches/**', 'src/liboliphaunt/postgres18/source.toml', 'src/liboliphaunt/src/**') }} | |
| restore-keys: | | |
| liboliphaunt-ccache-${{ matrix.target }}-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Configure native compiler cache | |
| run: .github/scripts/setup-native-build-tools.sh 2G | |
| - name: Run liboliphaunt checks | |
| env: | |
| LIBOLIPHAUNT_CI_TARGET: ${{ matrix.target }} | |
| run: | | |
| if [[ "${LIBOLIPHAUNT_CI_TARGET}" == "windows-x64-msvc" ]]; then | |
| targets=(liboliphaunt:release-runtime liboliphaunt:check) | |
| else | |
| targets=(liboliphaunt:release-runtime liboliphaunt:check liboliphaunt:test) | |
| fi | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Show native compiler cache stats | |
| if: ${{ always() }} | |
| env: | |
| LIBOLIPHAUNT_CI_TARGET: ${{ matrix.target }} | |
| run: | | |
| if [[ "${LIBOLIPHAUNT_CI_TARGET}" != windows-* ]] && command -v ccache >/dev/null 2>&1; then | |
| ccache --show-stats | |
| fi | |
| - name: Upload liboliphaunt build logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: liboliphaunt-logs-${{ matrix.target }} | |
| path: | | |
| ${{ matrix.build-root }}/*.log | |
| target/liboliphaunt/**/*.log | |
| if-no-files-found: ignore | |
| rust-sdk: | |
| name: rust-sdk | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'rust-sdk') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| components: clippy,llvm-tools-preview | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| tools: cargo-nextest@0.9.137,cargo-llvm-cov@0.8.7 | |
| - name: Run Rust SDK checks | |
| run: | | |
| targets=(oliphaunt-rust:check oliphaunt-rust:test oliphaunt-rust:package oliphaunt-rust:coverage repo:test) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload Rust SDK coverage | |
| if: ${{ hashFiles('target/coverage/oliphaunt-rust/summary.json') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-oliphaunt-rust | |
| path: target/coverage/oliphaunt-rust | |
| if-no-files-found: error | |
| swift-sdk: | |
| name: swift-sdk | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'swift-sdk') }} | |
| runs-on: macos-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Apple | |
| uses: ./.github/actions/setup-apple | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Run Swift SDK checks | |
| run: | | |
| targets=(oliphaunt-swift:check oliphaunt-swift:test oliphaunt-swift:package oliphaunt-swift:coverage) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload Swift SDK coverage | |
| if: ${{ hashFiles('target/coverage/oliphaunt-swift/summary.json') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-oliphaunt-swift | |
| path: target/coverage/oliphaunt-swift | |
| if-no-files-found: error | |
| kotlin-sdk: | |
| name: kotlin-sdk | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'kotlin-sdk') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Android | |
| uses: ./.github/actions/setup-android | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Run Kotlin SDK checks | |
| run: | | |
| targets=(oliphaunt-kotlin:check oliphaunt-kotlin:test oliphaunt-kotlin:package oliphaunt-kotlin:coverage) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload Kotlin SDK coverage | |
| if: ${{ hashFiles('target/coverage/oliphaunt-kotlin/summary.json') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-oliphaunt-kotlin | |
| path: target/coverage/oliphaunt-kotlin | |
| if-no-files-found: error | |
| react-native-sdk: | |
| name: react-native-sdk | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'react-native-sdk') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Android | |
| uses: ./.github/actions/setup-android | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Run React Native SDK checks | |
| run: | | |
| targets=(oliphaunt-react-native:check oliphaunt-react-native:test oliphaunt-react-native:package oliphaunt-react-native:coverage) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload React Native SDK coverage | |
| if: ${{ hashFiles('target/coverage/oliphaunt-react-native/summary.json') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-oliphaunt-react-native | |
| path: target/coverage/oliphaunt-react-native | |
| if-no-files-found: error | |
| typescript-sdk: | |
| name: typescript-sdk | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'typescript-sdk') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Set up Bun | |
| uses: ./.github/actions/setup-bun | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Run TypeScript SDK checks | |
| run: | | |
| targets=(oliphaunt-ts:check oliphaunt-ts:test oliphaunt-ts:package oliphaunt-ts:coverage) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload TypeScript SDK coverage | |
| if: ${{ hashFiles('target/coverage/oliphaunt-ts/summary.json') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-oliphaunt-ts | |
| path: target/coverage/oliphaunt-ts | |
| if-no-files-found: error | |
| wasm: | |
| name: wasm | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'wasm') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| components: llvm-tools-preview | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| tools: cargo-nextest@0.9.137,cargo-llvm-cov@0.8.7 | |
| - name: Run WASM checks | |
| run: | | |
| targets=(oliphaunt-wasm:check oliphaunt-wasm:test oliphaunt-wasm:package oliphaunt-wasm:coverage xtask:check oliphaunt-wasm:release-check) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload WASM coverage | |
| if: ${{ hashFiles('target/coverage/oliphaunt-wasm/summary.json') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-oliphaunt-wasm | |
| path: target/coverage/oliphaunt-wasm | |
| if-no-files-found: error | |
| wasm-runtime: | |
| name: wasm-runtime | |
| needs: | |
| - affected | |
| if: ${{ needs.affected.outputs.wasm_runtime_portable_required == 'true' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 | |
| permissions: | |
| contents: read | |
| actions: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Verify source-controlled asset inputs | |
| run: cargo run -p xtask -- assets verify-committed | |
| - name: Fetch pinned asset sources | |
| run: cargo run -p xtask -- assets fetch | |
| - name: Restore WASIX compilation cache | |
| id: wasix-build-cache | |
| uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 | |
| with: | |
| path: | | |
| target/liboliphaunt-pg18/source | |
| target/oliphaunt-wasm/wasix-build/source-cache | |
| target/oliphaunt-wasm/wasix-build/work/docker-oliphaunt | |
| target/oliphaunt-wasm/wasix-build/work/icu-native | |
| target/oliphaunt-wasm/wasix-build/work/icu-wasix | |
| target/oliphaunt-wasm/wasix-build/work/icu-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/json-c-wasix | |
| target/oliphaunt-wasm/wasix-build/work/json-c-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/libiconv-wasix | |
| target/oliphaunt-wasm/wasix-build/work/libiconv-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/libxml2-wasix | |
| target/oliphaunt-wasm/wasix-build/work/libxml2-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/openssl-wasix | |
| target/oliphaunt-wasm/wasix-build/work/openssl-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/proj-wasix | |
| target/oliphaunt-wasm/wasix-build/work/proj-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/sqlite-wasix | |
| target/oliphaunt-wasm/wasix-build/work/sqlite-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/geos-wasix | |
| target/oliphaunt-wasm/wasix-build/work/geos-wasix-build | |
| target/oliphaunt-wasm/wasix-build/build | |
| key: wasix-build-${{ runner.os }}-${{ env.ASSET_PROFILE }}-${{ hashFiles('src/oliphaunt-wasm/assets/generated/asset-inputs.sha256', 'src/postgres18/**', 'src/third-party/**', 'src/extensions/**', 'src/oliphaunt-wasm/assets/wasix-build/**', 'src/oliphaunt-wasm/crates/oliphaunt-wasm/Cargo.toml', 'src/oliphaunt-wasm/crates/oliphaunt-wasm-assets/**', 'tools/xtask/**', 'Cargo.toml', 'Cargo.lock') }} | |
| restore-keys: | | |
| wasix-build-${{ runner.os }}-${{ env.ASSET_PROFILE }}- | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd | |
| - name: Build WASIX builder image and save cache | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f | |
| with: | |
| context: src/oliphaunt-wasm/assets/wasix-build/docker | |
| file: src/oliphaunt-wasm/assets/wasix-build/docker/Dockerfile | |
| tags: oliphaunt-wasm-wasix-build:ci | |
| load: true | |
| cache-from: type=gha,scope=wasix-builder | |
| cache-to: type=gha,mode=max,scope=wasix-builder | |
| - name: Build WASIX builder image | |
| if: ${{ github.ref != 'refs/heads/main' }} | |
| uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f | |
| with: | |
| context: src/oliphaunt-wasm/assets/wasix-build/docker | |
| file: src/oliphaunt-wasm/assets/wasix-build/docker/Dockerfile | |
| tags: oliphaunt-wasm-wasix-build:ci | |
| load: true | |
| cache-from: type=gha,scope=wasix-builder | |
| - name: Install Wasmer LLVM 22.1 for WASIX template generation | |
| uses: ./.github/actions/setup-wasmer-llvm | |
| with: | |
| url: ${{ env.WASMER_LLVM_LINUX_X64_URL }} | |
| version: ${{ env.WASMER_LLVM_VERSION }} | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Build portable WASIX modules and package runtime assets | |
| env: | |
| IMAGE: oliphaunt-wasm-wasix-build:ci | |
| run: | | |
| cargo run -p xtask --features template-runner -- assets release-build \ | |
| --profile "$ASSET_PROFILE" \ | |
| --target-triple x86_64-unknown-linux-gnu \ | |
| --skip-aot \ | |
| --skip-package-size | |
| - name: Validate generated portable assets | |
| run: cargo run -p xtask -- assets check --strict-generated | |
| - name: Save WASIX compilation cache | |
| if: ${{ github.ref == 'refs/heads/main' && steps.wasix-build-cache.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 | |
| with: | |
| path: | | |
| target/liboliphaunt-pg18/source | |
| target/oliphaunt-wasm/wasix-build/source-cache | |
| target/oliphaunt-wasm/wasix-build/work/docker-oliphaunt | |
| target/oliphaunt-wasm/wasix-build/work/icu-native | |
| target/oliphaunt-wasm/wasix-build/work/icu-wasix | |
| target/oliphaunt-wasm/wasix-build/work/icu-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/json-c-wasix | |
| target/oliphaunt-wasm/wasix-build/work/json-c-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/libiconv-wasix | |
| target/oliphaunt-wasm/wasix-build/work/libiconv-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/libxml2-wasix | |
| target/oliphaunt-wasm/wasix-build/work/libxml2-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/openssl-wasix | |
| target/oliphaunt-wasm/wasix-build/work/openssl-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/proj-wasix | |
| target/oliphaunt-wasm/wasix-build/work/proj-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/sqlite-wasix | |
| target/oliphaunt-wasm/wasix-build/work/sqlite-wasix-build | |
| target/oliphaunt-wasm/wasix-build/work/geos-wasix | |
| target/oliphaunt-wasm/wasix-build/work/geos-wasix-build | |
| target/oliphaunt-wasm/wasix-build/build | |
| key: wasix-build-${{ runner.os }}-${{ env.ASSET_PROFILE }}-${{ hashFiles('src/oliphaunt-wasm/assets/generated/asset-inputs.sha256', 'src/postgres18/**', 'src/third-party/**', 'src/extensions/**', 'src/oliphaunt-wasm/assets/wasix-build/**', 'src/oliphaunt-wasm/crates/oliphaunt-wasm/Cargo.toml', 'src/oliphaunt-wasm/crates/oliphaunt-wasm-assets/**', 'tools/xtask/**', 'Cargo.toml', 'Cargo.lock') }} | |
| - name: Upload portable WASIX build outputs | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: oliphaunt-wasm-runtime-portable | |
| path: | | |
| target/oliphaunt-wasm/wasix-build/build/** | |
| target/oliphaunt-wasm/assets/** | |
| src/extensions/generated/** | |
| src/oliphaunt-wasm/assets/generated/** | |
| if-no-files-found: error | |
| wasm-aot-targets: | |
| name: wasm-aot-targets | |
| needs: | |
| - affected | |
| if: ${{ needs.affected.outputs.wasm_runtime_portable_required == 'true' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| matrix: ${{ steps.targets.outputs.matrix }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| persist-credentials: false | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Build target matrix | |
| id: targets | |
| env: | |
| REQUESTED_TARGET: ${{ github.event_name == 'workflow_dispatch' && inputs.wasm_target || 'all' }} | |
| run: cargo run --quiet -p xtask -- assets ci-matrix --target "$REQUESTED_TARGET" --github-output >> "$GITHUB_OUTPUT" | |
| wasm-aot: | |
| name: wasm-aot-${{ matrix.target }} | |
| needs: | |
| - affected | |
| - wasm-runtime | |
| - wasm-aot-targets | |
| if: ${{ needs.affected.outputs.wasm_runtime_portable_required == 'true' }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 180 | |
| permissions: | |
| contents: read | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.wasm-aot-targets.outputs.matrix || '{"include":[]}') }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Download portable WASIX build outputs | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: oliphaunt-wasm-runtime-portable | |
| path: . | |
| - name: Install Wasmer LLVM 22.1 for AOT generation | |
| uses: ./.github/actions/setup-wasmer-llvm | |
| with: | |
| url: ${{ matrix.llvm_url }} | |
| version: ${{ env.WASMER_LLVM_VERSION }} | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Generate and package target AOT artifacts | |
| env: | |
| AOT_TARGET: ${{ matrix.target }} | |
| run: | | |
| cargo run -p xtask -- assets aot --target-triple "$AOT_TARGET" | |
| cargo run -p xtask -- assets package-aot --target-triple "$AOT_TARGET" | |
| cargo run -p xtask -- assets check-aot --target-triple "$AOT_TARGET" | |
| - name: Check target AOT crate | |
| env: | |
| AOT_PACKAGE: ${{ matrix.package }} | |
| run: cargo check -p "$AOT_PACKAGE" --locked | |
| - name: Run asset smoke tests | |
| run: cargo run -p xtask -- assets smoke | |
| - name: Upload target artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: oliphaunt-wasm-runtime-aot-${{ matrix.target }} | |
| path: | | |
| target/oliphaunt-wasm/aot/${{ matrix.target }}/** | |
| if-no-files-found: error | |
| docs: | |
| name: docs | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'docs') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Run docs checks | |
| run: | | |
| targets=(oliphaunt-docs:check oliphaunt-docs:test oliphaunt-docs:build) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| - name: Upload docs preview | |
| if: ${{ hashFiles('target/oliphaunt-docs/build/**') != '' }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: oliphaunt-docs-preview | |
| path: target/oliphaunt-docs/build | |
| if-no-files-found: error | |
| coverage-summary: | |
| name: coverage-summary | |
| needs: | |
| - affected | |
| - rust-sdk | |
| - swift-sdk | |
| - kotlin-sdk | |
| - react-native-sdk | |
| - typescript-sdk | |
| - wasm | |
| if: ${{ always() && needs.affected.result == 'success' && contains(fromJson(needs.affected.outputs.jobs), 'coverage-summary') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Download Rust SDK coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: coverage-oliphaunt-rust | |
| path: target/coverage/oliphaunt-rust | |
| - name: Download Swift SDK coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: coverage-oliphaunt-swift | |
| path: target/coverage/oliphaunt-swift | |
| - name: Download Kotlin SDK coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: coverage-oliphaunt-kotlin | |
| path: target/coverage/oliphaunt-kotlin | |
| - name: Download React Native SDK coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: coverage-oliphaunt-react-native | |
| path: target/coverage/oliphaunt-react-native | |
| - name: Download TypeScript SDK coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: coverage-oliphaunt-ts | |
| path: target/coverage/oliphaunt-ts | |
| - name: Download WASM coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | |
| with: | |
| name: coverage-oliphaunt-wasm | |
| path: target/coverage/oliphaunt-wasm | |
| - name: Summarize coverage | |
| run: tools/coverage/summarize --allow-missing | |
| - name: Upload aggregate coverage summary | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: coverage-summary | |
| path: | | |
| target/coverage/summary.json | |
| target/coverage/summary.md | |
| if-no-files-found: error | |
| mobile-smoke: | |
| name: mobile-smoke | |
| needs: | |
| - affected | |
| if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && contains(fromJson(needs.affected.outputs.jobs), 'mobile-smoke') }} | |
| runs-on: macos-latest | |
| timeout-minutes: 180 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Apple | |
| uses: ./.github/actions/setup-apple | |
| - name: Set up Android | |
| uses: ./.github/actions/setup-android | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Run mobile smoke | |
| run: | | |
| cargo run -p xtask -- assets fetch | |
| pnpm moon run oliphaunt-react-native:smoke-mobile --cache off | |
| release-readiness: | |
| name: release-readiness | |
| needs: | |
| - affected | |
| if: ${{ contains(fromJson(needs.affected.outputs.jobs), 'release-readiness') }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Moon | |
| uses: ./.github/actions/setup-moon | |
| with: | |
| pnpm-version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| cache-save-if: ${{ env.RUST_CACHE_SAVE_IF }} | |
| - name: Run release readiness checks | |
| run: | | |
| targets=(release-tools:release-check release-tools:consumer-readiness) | |
| .github/scripts/run-moon-ci.sh "${targets[@]}" | |
| required: | |
| name: required | |
| if: ${{ always() }} | |
| needs: | |
| - affected | |
| - repo | |
| - release-intent | |
| - liboliphaunt | |
| - rust-sdk | |
| - swift-sdk | |
| - kotlin-sdk | |
| - react-native-sdk | |
| - typescript-sdk | |
| - wasm | |
| - wasm-runtime | |
| - wasm-aot-targets | |
| - wasm-aot | |
| - docs | |
| - coverage-summary | |
| - mobile-smoke | |
| - release-readiness | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check required jobs | |
| env: | |
| NEEDS_JSON: ${{ toJson(needs) }} | |
| REQUIRED_JOBS: ${{ needs.affected.outputs.jobs }} | |
| run: | | |
| python3 - <<'PY' | |
| import json | |
| import os | |
| import sys | |
| needs = json.loads(os.environ["NEEDS_JSON"]) | |
| try: | |
| required_jobs = set(json.loads(os.environ.get("REQUIRED_JOBS") or "[]")) | |
| except json.JSONDecodeError: | |
| required_jobs = set() | |
| required_jobs.add("affected") | |
| failures = [] | |
| for job, data in sorted(needs.items()): | |
| result = data["result"] | |
| if result == "success": | |
| continue | |
| if job not in required_jobs and result == "skipped": | |
| continue | |
| failures.append(f"{job}={result}") | |
| if failures: | |
| print("required job failures: " + ", ".join(failures), file=sys.stderr) | |
| raise SystemExit(1) | |
| print("required checks passed") | |
| PY |