Download .github/actions/setup-ci/action.yml from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 4.14 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/.github/actions/setup-ci/action.yml
- Command line
-
hf download hf://SaylorTwift/codex/.github/actions/setup-ci/action.yml
-
curl -L -o action.yml https://huggingface.co/SaylorTwift/codex/resolve/main/.github/actions/setup-ci/action.yml
4.14 kB
| name: setup-ci | |
| description: Prepare common tools and environment shared by CI jobs. | |
| outputs: | |
| bazel-output-base: | |
| description: Filesystem path used for Bazel's output base. | |
| value: ${{ steps.configure_ci_build_paths.outputs.bazel-output-base }} | |
| cargo-target-dir: | |
| description: Filesystem path used for Cargo's target directory. | |
| value: ${{ steps.configure_ci_build_paths.outputs.cargo-target-dir }} | |
| runs: | |
| using: composite | |
| steps: | |
| # setup-ci expects either this step or the Unix fallback below to define | |
| # CI_BUILD_ROOT. Windows uses a Dev Drive because Cargo and Bazel | |
| # spend significant time reading and writing build/cache trees. | |
| - name: Configure Dev Drive (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: ./.github/scripts/setup-dev-drive.ps1 | |
| - name: Configure CI build root (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: echo "CI_BUILD_ROOT=$HOME/.cache/codex-ci" >> "$GITHUB_ENV" | |
| - name: Enable unprivileged user namespaces (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| sudo sysctl -w kernel.unprivileged_userns_clone=1 | |
| if sudo sysctl -a 2>/dev/null | grep -q '^kernel.apparmor_restrict_unprivileged_userns'; then | |
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| fi | |
| - name: Configure CI build paths | |
| id: configure_ci_build_paths | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| # setup-bazel passes output_base explicitly, so keep both it and the | |
| # user root under the shared build root. Keep these directory names tiny | |
| # on every platform so Windows Bazel paths do not overflow argv or | |
| # confuse test MANIFEST handling. | |
| bazel_output_base="$CI_BUILD_ROOT/o" | |
| bazel_output_user_root="$CI_BUILD_ROOT/b" | |
| bazel_repository_cache="$CI_BUILD_ROOT/bazel-repository-cache" | |
| bazel_repo_contents_cache="$CI_BUILD_ROOT/bazel-repo-contents-cache-$GITHUB_RUN_ID-$GITHUB_JOB" | |
| cargo_target_dir="$CI_BUILD_ROOT/cargo-target" | |
| tmp="$CI_BUILD_ROOT/tmp" | |
| build_dirs=( | |
| "$bazel_output_base" | |
| "$bazel_output_user_root" | |
| "$bazel_repository_cache" | |
| "$bazel_repo_contents_cache" | |
| "$cargo_target_dir" | |
| "$tmp" | |
| ) | |
| mkdir -p "${build_dirs[@]}" | |
| echo "bazel-output-base=$bazel_output_base" >> "$GITHUB_OUTPUT" | |
| echo "cargo-target-dir=$cargo_target_dir" >> "$GITHUB_OUTPUT" | |
| { | |
| echo "CODEX_REPO_ROOT=$GITHUB_WORKSPACE" | |
| echo "BAZEL_OUTPUT_BASE=$bazel_output_base" | |
| echo "BAZEL_OUTPUT_USER_ROOT=$bazel_output_user_root" | |
| echo "BAZEL_REPOSITORY_CACHE=$bazel_repository_cache" | |
| echo "BAZEL_REPO_CONTENTS_CACHE=$bazel_repo_contents_cache" | |
| echo "CARGO_TARGET_DIR=$cargo_target_dir" | |
| echo "TEMP=$tmp" | |
| echo "TMP=$tmp" | |
| } >> "$GITHUB_ENV" | |
| - name: Prefer the Git CLI for Cargo git dependencies | |
| shell: bash | |
| run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> "$GITHUB_ENV" | |
| - name: Install DotSlash | |
| uses: facebook/install-dotslash@1e4e7b3e07eaca387acb98f1d4720e0bee8dbb6a # v2 | |
| - name: Install just | |
| uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2.62.49 | |
| with: | |
| tool: just@1.51.0 | |
| # Some integration tests spawn DotSlash from a stable system path rather | |
| # than inheriting the action-local PATH entry. | |
| - name: Make DotSlash available in PATH (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| if [[ -w /usr/local/bin ]]; then | |
| cp "$(which dotslash)" /usr/local/bin | |
| else | |
| sudo cp "$(which dotslash)" /usr/local/bin | |
| fi | |
| - name: Make DotSlash available in PATH (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: Copy-Item (Get-Command dotslash).Source -Destination "$env:LOCALAPPDATA\Microsoft\WindowsApps\dotslash.exe" | |
| - name: Enable Git long paths (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: git config --global core.longpaths true | |