ci: download gen_init_cpio with authentication

API rate limiting seems broken - let's hope this gets around it.
pull/1116/head
Tamir Duberstein
parent 1dfcfbcf90
commit f955e7145f
No known key found for this signature in database

@ -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

@ -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<String>,
/// 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",

Loading…
Cancel
Save