Repository navigation
ci: run CI, cloud tests, conformance and CodeQL on the CodeBuild runner #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Ensure rustup | ||
| description: >- | ||
| Make `rustup` available on the job PATH. GitHub-hosted runners preinstall it; | ||
| the CodeBuild standard image does not. When it is absent, install a pinned | ||
| rustup-init (version and sha256 below) with no default toolchain, so the | ||
| workflow's own `rustup toolchain install` lines keep deciding which toolchain | ||
| is used. No-op when rustup is already present. | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install rustup if missing | ||
| shell: bash | ||
| env: | ||
| RUSTUP_INIT_VERSION: 1.29.1 | ||
| RUSTUP_INIT_SHA256: dda7234360b7f578ca8b0ddcb80145646fa61a67c1720a5abc7051b35c9fcb71 | ||
| run: | | ||
| set -euo pipefail | ||
| if command -v rustup >/dev/null 2>&1; then | ||
| echo "rustup present: $(command -v rustup)" | ||
| exit 0 | ||
| fi | ||
| if [ "$(uname -m)" != "x86_64" ]; then | ||
| echo "::error::ensure-rustup only pins the x86_64 rustup-init; runner is $(uname -m)" | ||
| exit 1 | ||
| fi | ||
| tmp="$(mktemp -d)" | ||
| curl -fsSL --proto '=https' --tlsv1.2 \ | ||
| "https://static.rust-lang.org/rustup/archive/${RUSTUP_INIT_VERSION}/x86_64-unknown-linux-gnu/rustup-init" \ | ||
| -o "$tmp/rustup-init" | ||
| echo "${RUSTUP_INIT_SHA256} $tmp/rustup-init" | sha256sum -c - | ||
| chmod +x "$tmp/rustup-init" | ||
| "$tmp/rustup-init" -y --no-modify-path --profile minimal --default-toolchain none | ||
| rm -rf "$tmp" | ||
| echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | ||
| "$HOME/.cargo/bin/rustup" --version |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,11 @@ permissions: | |
| jobs: | ||
| example-tests: | ||
| name: example-tests | ||
| runs-on: ubuntu-latest | ||
| # CodeBuild-hosted runner in the Rust testing account (EC2 compute); the label | ||
| # must match the CodeBuild project name. Pull requests from forks are routed | ||
| # to GitHub-hosted runners. This is routing, not a trust boundary: the fork | ||
| # boundary is the repository's approval setting for fork workflows. | ||
| runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || format('codebuild-github-actions-runner-{0}-{1}', github.run_id, github.run_attempt) }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This moves the job to a CodeBuild project with a stated 60-minute limit, but the next line retains |
||
| timeout-minutes: 90 | ||
| permissions: | ||
| contents: read | ||
|
|
@@ -42,6 +46,8 @@ jobs: | |
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
|
|
||
| - uses: ./.github/actions/ensure-rustup | ||
|
|
||
| - name: Install Rust toolchain | ||
| run: | | ||
| rustup toolchain install stable --profile minimal | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include Dependabot in the hosted-runner condition. Dependabot branches belong to this repository, so the current expression runs updated dependency build scripts and procedural macros inside the CodeBuild account before maintainer review. Python PR 747 routes Dependabot builds to
ubuntu-latest. Please addgithub.actor == 'dependabot[bot]'to this condition and the repeated conditions. The cloud and conformance workflows should instead skip fork and Dependabot PRs because those jobs require unavailable secrets.