ci: Make sure compiling for wasm works
This commit is contained in:
parent
4f65489e8d
commit
d73f84ebcc
@ -54,6 +54,8 @@ pub enum CiCmd {
|
|||||||
NightlyFull,
|
NightlyFull,
|
||||||
/// Lint default features with clippy (nightly)
|
/// Lint default features with clippy (nightly)
|
||||||
ClippyDefault,
|
ClippyDefault,
|
||||||
|
/// Lint ruma-common with clippy on a wasm target (nightly)
|
||||||
|
ClippyWasm,
|
||||||
/// Lint almost all features with clippy (nightly)
|
/// Lint almost all features with clippy (nightly)
|
||||||
ClippyAll,
|
ClippyAll,
|
||||||
/// Run all lints that don't need compilation
|
/// Run all lints that don't need compilation
|
||||||
@ -102,6 +104,7 @@ impl CiTask {
|
|||||||
Some(CiCmd::Fmt) => self.fmt()?,
|
Some(CiCmd::Fmt) => self.fmt()?,
|
||||||
Some(CiCmd::NightlyFull) => self.nightly_full()?,
|
Some(CiCmd::NightlyFull) => self.nightly_full()?,
|
||||||
Some(CiCmd::ClippyDefault) => self.clippy_default()?,
|
Some(CiCmd::ClippyDefault) => self.clippy_default()?,
|
||||||
|
Some(CiCmd::ClippyWasm) => self.clippy_wasm()?,
|
||||||
Some(CiCmd::ClippyAll) => self.clippy_all()?,
|
Some(CiCmd::ClippyAll) => self.clippy_all()?,
|
||||||
Some(CiCmd::Lint) => self.lint()?,
|
Some(CiCmd::Lint) => self.lint()?,
|
||||||
Some(CiCmd::Dependencies) => self.dependencies()?,
|
Some(CiCmd::Dependencies) => self.dependencies()?,
|
||||||
@ -203,6 +206,7 @@ impl CiTask {
|
|||||||
self.fmt()?;
|
self.fmt()?;
|
||||||
self.nightly_full()?;
|
self.nightly_full()?;
|
||||||
self.clippy_default()?;
|
self.clippy_default()?;
|
||||||
|
self.clippy_wasm()?;
|
||||||
self.clippy_all()
|
self.clippy_all()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,6 +248,21 @@ impl CiTask {
|
|||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Lint ruma-common with clippy with the nightly version and wasm target.
|
||||||
|
///
|
||||||
|
/// ruma-common is currently the only crate with wasm-specific code. If that changes, this
|
||||||
|
/// method should be updated.
|
||||||
|
fn clippy_wasm(&self) -> Result<()> {
|
||||||
|
cmd!(
|
||||||
|
"
|
||||||
|
rustup run {NIGHTLY} cargo clippy --target wasm32-unknown-unknown
|
||||||
|
-p ruma-common --features api,events,js,markdown,rand
|
||||||
|
"
|
||||||
|
)
|
||||||
|
.run()
|
||||||
|
.map_err(Into::into)
|
||||||
|
}
|
||||||
|
|
||||||
/// Lint almost all features with clippy with the nightly version.
|
/// Lint almost all features with clippy with the nightly version.
|
||||||
fn clippy_all(&self) -> Result<()> {
|
fn clippy_all(&self) -> Result<()> {
|
||||||
cmd!(
|
cmd!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user