Skip to content

Commit

Permalink
ci: don't use the unmaintained actions-rs actions
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zak <[email protected]>
  • Loading branch information
rjzak committed Mar 2, 2024
1 parent d73a2be commit f6c50f8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 38 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Setup Rust toolchain
run: rustup show && rustup update
- run: cargo install cargo-readme
- run: cargo readme > README.md && git diff --exit-code

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ jobs:
- name: Setup Rust toolchain
run: rustup show
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-features -- -D warnings
run: cargo clippy --workspace --all-features --tests -- -D warnings

nix-fmt:
name: nix fmt
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ jobs:
- name: Setup Rust toolchain
run: rustup show
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features
run: cargo test --workspace --all-features

wasi:
runs-on: ubuntu-latest
Expand All @@ -29,7 +26,4 @@ jobs:
- name: Check wasmtime version
run: wasmtime --version
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features --target=wasm32-wasi
run: cargo test --workspace --all-features --target=wasm32-wasi
25 changes: 10 additions & 15 deletions crates/attestation/src/crypto/crl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ mod tests {
let rdns = RdnSequence::from_der(&rdns).unwrap();

// Create the extensions.
let ku = KeyUsage((KeyUsages::KeyCertSign | KeyUsages::CRLSign).into())
let ku = KeyUsage(KeyUsages::KeyCertSign | KeyUsages::CRLSign)
.to_vec()
.unwrap();
let bc = BasicConstraints {
Expand Down Expand Up @@ -267,7 +267,7 @@ mod tests {
// Create the certificate body.
let tbs = TbsCertificate {
version: x509::Version::V3,
serial_number: cert_serial.clone(),
serial_number: *cert_serial,
signature: pki.signs_with().unwrap(),
issuer: rdns_issuer,
validity,
Expand Down Expand Up @@ -315,19 +315,17 @@ mod tests {
let rdns = RdnSequence::encode_from_string(TEST_ISSUER).unwrap();
let rdns = RdnSequence::from_der(&rdns).unwrap();

let revoked = if let Some(serial) = cert_serial {
Some(vec![RevokedCert {
serial_number: serial,
let revoked = cert_serial.map(|s| {
vec![RevokedCert {
serial_number: s,
revocation_date: yesterday,
crl_entry_extensions: None,
}])
} else {
None
};
}]
});

let tbs_cert = TbsCertList {
version: Default::default(),
signature: ca_cert.signature_algorithm.clone(),
signature: ca_cert.signature_algorithm,
issuer: rdns,
this_update: yesterday,
next_update: None,
Expand All @@ -336,15 +334,12 @@ mod tests {
};

let signature = ca_pki
.sign(
&tbs_cert.to_vec().unwrap(),
ca_cert.signature_algorithm.clone(),
)
.sign(&tbs_cert.to_vec().unwrap(), ca_cert.signature_algorithm)
.unwrap();

let crl = CertificateList {
tbs_cert_list: tbs_cert,
signature_algorithm: ca_cert.signature_algorithm.clone(),
signature_algorithm: ca_cert.signature_algorithm,
signature: BitStringRef::from_bytes(&signature).unwrap(),
};

Expand Down
4 changes: 2 additions & 2 deletions crates/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ mod tests {
#[test]
fn test_sgx_signed_csr_bad_config_enclave_version() {
let csr = CertReq::from_der(ICELAKE_I5_CSR).unwrap();
let config: Config = toml::from_str(&*format!(
let config: Config = toml::from_str(&format!(
r#"
[sgx]
signer = ["{SIGNER}"]
Expand All @@ -925,7 +925,7 @@ mod tests {
#[test]
fn test_sgx_signed_csr_extra_tcb_advisories() {
let csr = CertReq::from_der(ICELAKE_I5_CSR).unwrap();
let config: Config = toml::from_str(&*format!(
let config: Config = toml::from_str(&format!(
r#"
[sgx]
signer = ["{SIGNER}"]
Expand Down

0 comments on commit f6c50f8

Please sign in to comment.