From f955e7145f8d2b97bcca555850dc14f3052e2e76 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 12 Dec 2024 18:20:06 -0500 Subject: [PATCH] ci: download gen_init_cpio with authentication API rate limiting seems broken - let's hope this gets around it. --- .github/workflows/ci.yml | 5 ++++- xtask/src/run.rs | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 868d1f67..c4d4d6a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -299,7 +299,10 @@ jobs: run: cargo xtask integration-test local - name: Run virtualized integration tests - run: find test/.tmp -name 'vmlinuz-*' | xargs -t cargo xtask integration-test vm + run: | + set -euxo pipefail + find test/.tmp -name 'vmlinuz-*' -print0 | xargs -t -0 \ + cargo xtask integration-test vm --github-api-token ${{ secrets.GITHUB_TOKEN }} # Provides a single status check for the entire build workflow. # This is used for merge automation, like Mergify, since GH actions diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 98f55c61..50b68fcd 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -24,6 +24,10 @@ enum Environment { }, /// Runs the integration tests in a VM. VM { + /// The Github API token to use if network requests to Github are made. + #[clap(long)] + github_api_token: Option, + /// The kernel images to use. /// /// You can download some images with: @@ -167,7 +171,10 @@ pub fn run(opts: Options) -> Result<()> { Err(anyhow!("failures:\n{}", failures)) } } - Environment::VM { kernel_image } => { + Environment::VM { + github_api_token, + kernel_image, + } => { // The user has asked us to run the tests on a VM. This is involved; strap in. // // We need tools to build the initramfs; we use gen_init_cpio from the Linux repository, @@ -193,6 +200,10 @@ pub fn run(opts: Options) -> Result<()> { .context("failed to check existence of gen_init_cpio")? { let mut curl = Command::new("curl"); + if let Some(github_api_token) = github_api_token { + curl.arg("--header") + .arg(format!("authorization: Bearer {github_api_token}")); + } curl.args([ "-sfSL", "https://raw.githubusercontent.com/torvalds/linux/master/usr/gen_init_cpio.c",